-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicate notifications when switching chains #146
Fix duplicate notifications when switching chains #146
Conversation
✅ Deploy Preview for l2-flexible-voting ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
hooks/useEasyWrite.ts
Outdated
console.log('notify success'); | ||
setIsNotificationShownAlready(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for the first bridge, but if I try to bridge twice than my success toast doesn't get shown. We have to reset the isNotificationShownAlready
state when a new toast is fired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here: 7326eda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think the overall approach of this PR is good and can be taken out of Draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! After working on the notifications, I think it may be better if we handle this in the NotificationProvider
. In this function. If the notification id is the same we shouldn't add it to setNotifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, like this? https://github.com/ScopeLift/l2-flexible-voting-frontend/pull/146/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! will take out of draft now.
7326eda
to
eb8a56e
Compare
Before:
Screen.Recording.2023-11-22.at.2.04.09.PM.mov
After:
Screen.Recording.2023-11-22.at.2.02.41.PM.mov
closes #103