Skip to content

Commit

Permalink
fix: add space + only show banner on added Safes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Sep 25, 2023
1 parent 8c381b2 commit e18c16b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export const GlobalPushNotifications = (): ReactElement | null => {
<Box display="flex" alignItems="center">
{totalSignaturesRequired > 0 && (
<Typography display="inline" mr={2} textAlign="right">
We&apos;ll ask you to verify ownership of each Safe Account with your signature per chain
We&apos;ll ask you to verify ownership of each Safe Account with your signature per chain{' '}
{totalSignaturesRequired} time {totalSignaturesRequired > 1 ? 's' : ''}
</Typography>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ export const PushNotificationsBanner = ({ children }: { children: ReactElement }
const isNotificationsEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const addedSafes = useAppSelector(selectAllAddedSafes)
const totalAddedSafes = useAppSelector(selectTotalAdded)
const { safe } = useSafeInfo()
const { safe, safeAddress } = useSafeInfo()
const { query } = useRouter()
const onboard = useOnboard()

const { dismissPushNotificationBanner, isPushNotificationBannerDismissed } = useDismissPushNotificationsBanner()

const hasAddedSafesOnChain = Object.values(addedSafes[safe.chainId] || {}).length > 0
const shouldShowBanner = !isPushNotificationBannerDismissed && hasAddedSafesOnChain
const isSafeAdded = !!addedSafes?.[safe.chainId]?.[safeAddress]
const shouldShowBanner = isNotificationsEnabled && !isPushNotificationBannerDismissed && isSafeAdded

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

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

Expand Down

0 comments on commit e18c16b

Please sign in to comment.