From ed938527fdd69c152675d89d94e293bc203d6deb Mon Sep 17 00:00:00 2001 From: keyan Date: Mon, 12 Jun 2023 15:37:12 -0500 Subject: [PATCH] simply respect notification alert message --- components/notifications.js | 8 +++++--- pages/settings.js | 27 +-------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/components/notifications.js b/components/notifications.js index 95212f8d..f73ae419 100644 --- a/components/notifications.js +++ b/components/notifications.js @@ -257,8 +257,10 @@ function NotificationAlert () { const pushNotify = useNotification() useEffect(() => { - setShowAlert(!localStorage.getItem('hideNotifyPrompt')) - }, []) + // basically, we only want to show the alert if the user hasn't interacted with + // either opt-in of the double opt-in + setShowAlert(pushNotify.isDefault && !localStorage.getItem('hideNotifyPrompt')) + }, [pushNotify]) const close = () => { localStorage.setItem('hideNotifyPrompt', 'yep') @@ -268,7 +270,7 @@ function NotificationAlert () { return ( showAlert ? ( - + Enable push notifications?