diff --git a/src/pages/KeyPage/Key.Page.tsx b/src/pages/KeyPage/Key.Page.tsx index 35d91d9..30ba292 100644 --- a/src/pages/KeyPage/Key.Page.tsx +++ b/src/pages/KeyPage/Key.Page.tsx @@ -104,14 +104,17 @@ const KeyPage = () => { const handleOpenSettingsModal = () => handleOpen(MODAL_PARAMS_KEYS.SETTINGS) useEffect(() => { - if (swr) { - const isBackgroundEnable = swr.pushManager.getSubscription() - if (!isBackgroundEnable) { - setShowWarning(true) - } else { - setShowWarning(false) + const checkBackgroundSigning = async () => { + if (swr) { + const isBackgroundEnable = await swr.pushManager.getSubscription() + if (!isBackgroundEnable) { + setShowWarning(true) + } else { + setShowWarning(false) + } } } + checkBackgroundSigning() }, []) const handleEnableBackground = async () => { diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 65e7390..c786acc 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -1,4 +1,3 @@ export const NIP46_RELAYS = ['wss://relay.login.nostrapps.org'] export const NOAUTHD_URL = process.env.REACT_APP_NOAUTHD_URL export const WEB_PUSH_PUBKEY = process.env.REACT_APP_WEB_PUSH_PUBKEY -