Skip to content

Commit

Permalink
fix: rename notification feature variables
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Oct 6, 2023
1 parent 3ac6276 commit 6d36fb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const _getSafesToRegister = (
}

export const PushNotificationsBanner = ({ children }: { children: ReactElement }): ReactElement => {
const isNotificationsEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const isNotificationFeatureEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const chain = useCurrentChain()
const totalAddedSafes = useAppSelector(selectTotalAdded)
const { safe, safeAddress } = useSafeInfo()
Expand All @@ -101,7 +101,7 @@ export const PushNotificationsBanner = ({ children }: { children: ReactElement }
const isSafeAdded = !!addedSafesOnChain?.[safeAddress]
const isSafeRegistered = getPreferences(safe.chainId, safeAddress)
const shouldShowBanner =
isNotificationsEnabled && !isPushNotificationBannerDismissed && isSafeAdded && !isSafeRegistered
isNotificationFeatureEnabled && !isPushNotificationBannerDismissed && isSafeAdded && !isSafeRegistered

const { registerNotifications } = useNotificationRegistrations()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ const handleTrackCachedNotificationEvents = async (
}

export const useNotificationTracking = (): void => {
const isNotificationsEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const isNotificationFeatureEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)

useEffect(() => {
if (typeof indexedDB !== 'undefined' && isNotificationsEnabled) {
if (typeof indexedDB !== 'undefined' && isNotificationFeatureEnabled) {
handleTrackCachedNotificationEvents(createNotificationTrackingIndexedDb())
}
}, [isNotificationsEnabled])
}, [isNotificationFeatureEnabled])
}
4 changes: 2 additions & 2 deletions src/components/settings/SettingsHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { FEATURES } from '@/utils/chains'

const SettingsHeader = (): ReactElement => {
const safeAddress = useSafeAddress()
const isNotificationsEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const isNotificationFeatureEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)

const navItems = safeAddress ? settingsNavItems : generalSettingsNavItems
const filteredNavItems = isNotificationsEnabled
const filteredNavItems = isNotificationFeatureEnabled
? navItems
: navItems.filter((item) => item.href !== AppRoutes.settings.notifications)

Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useHasFeature } from '@/hooks/useChains'
import { FEATURES } from '@/utils/chains'

const NotificationsPage: NextPage = () => {
const isNotificationsEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)
const isNotificationFeatureEnabled = useHasFeature(FEATURES.PUSH_NOTIFICATIONS)

if (!isNotificationsEnabled) {
if (!isNotificationFeatureEnabled) {
return null
}

Expand Down

0 comments on commit 6d36fb7

Please sign in to comment.