Skip to content

Commit

Permalink
fix invite code issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zkLeonardo committed Aug 23, 2024
1 parent 17d0da5 commit ffa902d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ export default function Header() {

if (queryInviteCode && queryInviteCode.length === 6) {
dispatch(setInviteCode(queryInviteCode));
} else {
dispatch(setInviteCode("zklink"));
}

if (flag) {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/AggregationParade/SoftKYC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ export default function SoftKYC() {
const onChangeInviteCode = (value: string) => {
setInviteCodeValue(value);
dispatch(setIsCheckedInviteCode(false));

dispatch(setInviteCode(""));
};

const enterInviteCode = async (code: string) => {
Expand Down Expand Up @@ -594,6 +592,7 @@ export default function SoftKYC() {
}, [searchParams]);

useEffect(() => {
console.log("invite code", inviteCode);
if (validInviteCode(inviteCode)) {
setInviteCodeValue(inviteCode);
}
Expand Down
8 changes: 1 addition & 7 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ffa902d

Please sign in to comment.