diff --git a/src/shared/helpers/ConfigHelper.ts b/src/shared/helpers/ConfigHelper.ts index dbf857c9a..402912494 100644 --- a/src/shared/helpers/ConfigHelper.ts +++ b/src/shared/helpers/ConfigHelper.ts @@ -532,14 +532,7 @@ export class ConfigHelper { enable: serverConfig.config.staticPrompts.bell.enabled, displayPredicate: serverConfig.config.staticPrompts.bell .hideWhenSubscribed - ? () => { - return OneSignal.isPushNotificationsEnabled().then( - (isPushEnabled: boolean) => { - /* The user is subscribed, so we want to return "false" to hide the notify button */ - return !isPushEnabled; - }, - ); - } + ? () => !OneSignal.User.PushSubscription.optedIn : null, size: serverConfig.config.staticPrompts.bell.size, position: serverConfig.config.staticPrompts.bell.location, diff --git a/src/shared/models/Prompts.ts b/src/shared/models/Prompts.ts index fec8b30c6..59d50fa49 100644 --- a/src/shared/models/Prompts.ts +++ b/src/shared/models/Prompts.ts @@ -123,7 +123,7 @@ export interface BellText { export interface AppUserConfigNotifyButton { options?: AppUserConfigNotifyButton; enable: boolean; - displayPredicate?: () => void | null | undefined; + displayPredicate?: null | (() => void | null | undefined | boolean); size?: BellSize; position?: BellPosition; offset?: { bottom: string; left: string; right: string };