-
Notifications
You must be signed in to change notification settings - Fork 463
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: don't show banner if preferences exist #2596
Conversation
Branch preview✅ Deploy successful! https://notification_banner_preferences--walletweb.review-wallet-web.5afe.dev |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
const shouldShowBanner = isNotificationsEnabled && !isPushNotificationBannerDismissed && isSafeAdded | ||
const isSafeRegistered = getPreferences(safe.chainId, safeAddress) | ||
const shouldShowBanner = | ||
isNotificationsEnabled && !isPushNotificationBannerDismissed && isSafeAdded && !isSafeRegistered |
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.
Could you rename isNotificationsEnabled
to something like isFeatureEnabled
? It's confusing wrt user enabling notifications/allowing push notifications.
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.
Looks good to me. We could consider writing a test for the Banner component as it's complexity grew a bit.
src/components/settings/PushNotifications/PushNotificationsBanner/index.tsx
Show resolved
Hide resolved
Looks good. The pop up dissapears if you enable notifications in the safe settings |
What it solves
Resolves #2592 (comment)
How this PR fixes it
The notification registration banner now takes into account whether the current Safe is registered before being displayed.
How to test it
Screenshots
Checklist