Skip to content

Commit

Permalink
Only update streak if user exists
Browse files Browse the repository at this point in the history
  • Loading branch information
binamkayastha committed Jul 22, 2024
1 parent ea125c3 commit 3fa5654
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nepalingo-web/src/hooks/StreakContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export const StreakProvider = ({ children }: { children: ReactNode }) => {
};

useEffect(() => {
updateStreakState();
if (user) {
updateStreakState();
}
}, [user]);

const updateStreak = async () => {
Expand Down

0 comments on commit 3fa5654

Please sign in to comment.