Skip to content

Commit eebccd1

Browse files
committed
refactor(rewards): remove unused desktop cloud status and simplify QR code sharing
- Eliminated the use of desktop cloud status in the rewards page. - Updated QR code sharing functionality to use a fixed mobile share URL instead of resolving from cloud URL.
1 parent f539ab4 commit eebccd1

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

apps/web/src/pages/rewards.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { formatRewardAmount } from "@/components/rewards/home-rewards-teaser";
22
import { RewardTaskIcon } from "@/components/rewards/reward-task-icon";
33
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
44
import { useCloudConnect } from "@/hooks/use-cloud-connect";
5-
import { useDesktopCloudStatus } from "@/hooks/use-desktop-cloud-status";
65
import { useDesktopRewardsStatus } from "@/hooks/use-desktop-rewards";
76
import { openExternalUrl } from "@/lib/desktop-links";
87
import {
@@ -24,14 +23,7 @@ import { useTranslation } from "react-i18next";
2423
import { Link } from "react-router-dom";
2524
import { toast } from "sonner";
2625

27-
function resolveCloudShareUrl(cloudUrl?: string | null): string {
28-
if (!cloudUrl) return "https://nexu.net";
29-
try {
30-
return new URL(cloudUrl).origin;
31-
} catch {
32-
return "https://nexu.net";
33-
}
34-
}
26+
const MOBILE_SHARE_QR_URL = "https://github.com/nexu-io/nexu";
3527

3628
const REWARD_GROUPS: Array<{
3729
key: RewardTaskStatus["group"];
@@ -238,8 +230,6 @@ export function RewardsPage() {
238230
string | null
239231
>(null);
240232

241-
const { data: desktopCloudStatus } = useDesktopCloudStatus();
242-
243233
const { cloudConnecting, handleCloudConnect } = useCloudConnect({
244234
cloudConnected: status.viewer.cloudConnected,
245235
onPoll: refresh,
@@ -577,9 +567,7 @@ export function RewardsPage() {
577567
<div className="flex items-center gap-4 rounded-lg px-3 py-3">
578568
<div className="shrink-0 rounded-xl border border-border bg-white p-1.5">
579569
<QRCodeSVG
580-
value={resolveCloudShareUrl(
581-
desktopCloudStatus?.cloudUrl,
582-
)}
570+
value={MOBILE_SHARE_QR_URL}
583571
size={56}
584572
/>
585573
</div>

0 commit comments

Comments
 (0)