From ffa902dcf1e2a9e109d2f13abd5f411f2b31f2f7 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 23 Aug 2024 10:54:53 +0800 Subject: [PATCH] fix invite code issue --- src/components/Header.tsx | 2 -- src/pages/AggregationParade/SoftKYC.tsx | 3 +-- src/pages/Home.tsx | 8 +------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 93075d01..bad15025 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -196,8 +196,6 @@ export default function Header() { if (queryInviteCode && queryInviteCode.length === 6) { dispatch(setInviteCode(queryInviteCode)); - } else { - dispatch(setInviteCode("zklink")); } if (flag) { diff --git a/src/pages/AggregationParade/SoftKYC.tsx b/src/pages/AggregationParade/SoftKYC.tsx index c57f55cf..b8885c50 100644 --- a/src/pages/AggregationParade/SoftKYC.tsx +++ b/src/pages/AggregationParade/SoftKYC.tsx @@ -347,8 +347,6 @@ export default function SoftKYC() { const onChangeInviteCode = (value: string) => { setInviteCodeValue(value); dispatch(setIsCheckedInviteCode(false)); - - dispatch(setInviteCode("")); }; const enterInviteCode = async (code: string) => { @@ -594,6 +592,7 @@ export default function SoftKYC() { }, [searchParams]); useEffect(() => { + console.log("invite code", inviteCode); if (validInviteCode(inviteCode)) { setInviteCodeValue(inviteCode); } diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 07b277bb..331ac6c6 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -243,15 +243,9 @@ export default function Home() { const enterInviteCode = async () => { console.log("enter invite code", otp); if (!otp || otp.length !== 6) return; - // TODO: check invite code ? - // const res = await checkInviteCode(otp); - // if (!res?.result) { - // toast.error("Invalid invite code. Try another.", { duration: 3000 }); - // return; - // } dispatch(setInviteCode(otp)); - navigator("/aggregation-parade"); + navigator(`/aggregation-parade`); }; const [isLoading, setIsLoading] = useState(false);