diff --git a/apps/trading/client-pages/referrals/apply-code-form.tsx b/apps/trading/client-pages/referrals/apply-code-form.tsx index 9c52e18ee..fee308e9e 100644 --- a/apps/trading/client-pages/referrals/apply-code-form.tsx +++ b/apps/trading/client-pages/referrals/apply-code-form.tsx @@ -133,15 +133,11 @@ export const ApplyCodeForm = () => { // go to main page when successfully applied useEffect(() => { - let to: ReturnType; if (status === 'successful') { - to = setTimeout(() => { + setTimeout(() => { navigate(Routes.REFERRALS); }, RELOAD_DELAY); } - return () => { - if (to) clearTimeout(to); - }; }, [navigate, status]); // go to main page if the current pubkey is already a referrer or referee diff --git a/apps/trading/client-pages/referrals/hooks/use-referral.ts b/apps/trading/client-pages/referrals/hooks/use-referral.ts index e08bb2e34..749d04da4 100644 --- a/apps/trading/client-pages/referrals/hooks/use-referral.ts +++ b/apps/trading/client-pages/referrals/hooks/use-referral.ts @@ -77,6 +77,7 @@ export const useReferral = (args: UseReferralArgs) => { }, skip: !referralSet?.id, fetchPolicy: 'cache-and-network', + //context: { isEnlargedTimeout: true }, }); const referees = compact( diff --git a/apps/trading/client-pages/referrals/referrals.tsx b/apps/trading/client-pages/referrals/referrals.tsx index 39237cc82..3afbbf712 100644 --- a/apps/trading/client-pages/referrals/referrals.tsx +++ b/apps/trading/client-pages/referrals/referrals.tsx @@ -46,7 +46,7 @@ export const Referrals = () => { const error = refereeError || referrerError; const loading = refereeLoading || referrerLoading; - const showNav = !loading && !referrer && !referee; + const showNav = !loading && !error && !referrer && !referee; return ( <> @@ -64,8 +64,9 @@ export const Referrals = () => { ) : error ? ( -
- Something went wrong +
+

Something went wrong

+ {error.message}
) : (