Skip to content

Commit

Permalink
fix usage of hasShownUnstakeNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmxdiqbal committed Jan 15, 2025
1 parent b0b89ec commit be2a41b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hooks/useNodeStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ export const useNodeStatus = (): NodeStatusResponse => {
let hasShownUnstakeNotification = false

useEffect(() => {
localStorage.getItem('hasShownUnstakeNotification') ? hasShownUnstakeNotification = true : hasShownUnstakeNotification = false
localStorage.getItem('hasShownUnstakeNotification') === 'true' ? hasShownUnstakeNotification = true : hasShownUnstakeNotification = false
if (data?.stakeState?.unlocked && !hasShownUnstakeNotification) {
setShowUnstakeNotification(true);
} else if (data?.stakeState?.unlocked === false && hasShownUnstakeNotification) {
hasShownUnstakeNotification = false
localStorage.setItem('hasShownUnstakeNotification', 'false')
}
}, [data]);
Expand Down

0 comments on commit be2a41b

Please sign in to comment.