Skip to content

Commit

Permalink
Fix: close immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 20, 2023
1 parent a1b933c commit 3165deb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import useDebounce from '@/hooks/useDebounce'
import css from './styles.module.css'

const DISMISS_PUSH_NOTIFICATIONS_KEY = 'dismissPushNotifications'
const BANNER_DELAY = 3000

export const useDismissPushNotificationsBanner = () => {
const addedSafes = useAppSelector(selectAllAddedSafes)
Expand Down Expand Up @@ -121,7 +122,7 @@ export const PushNotificationsBanner = ({ children }: { children: ReactElement }
const isSafeRegistered = getPreferences(safe.chainId, safeAddress)
const shouldShowBanner = useDebounce(
isNotificationFeatureEnabled && !isPushNotificationBannerDismissed && isSafeAdded && !isSafeRegistered && !!wallet,
3000,
BANNER_DELAY,
)

const { registerNotifications } = useNotificationRegistrations()
Expand Down Expand Up @@ -166,7 +167,7 @@ export const PushNotificationsBanner = ({ children }: { children: ReactElement }
dismissBanner()
}

if (!shouldShowBanner) {
if (!shouldShowBanner || isPushNotificationBannerDismissed) {
return children
}

Expand Down

0 comments on commit 3165deb

Please sign in to comment.