Skip to content

Commit

Permalink
fix(header): disable payment check when user not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Feb 18, 2024
1 parent 1fa6ebd commit 52bebdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export default function Header() {
});

const checkUserPaid = useSWR<{ paid: boolean }>(['payment'], fetcher.get.query, {
isPaused: () => clerkUser.isLoaded && !clerkUser.isSignedIn,
isPaused: () => {
if (clerkUser.isLoaded && !clerkUser.isSignedIn) {
return true;
}
return !checkUserExists.data?.exists;
},
});

const [isScrolled, setIsScrolled] = useState(false);
Expand Down

0 comments on commit 52bebdb

Please sign in to comment.