diff --git a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx index 4c7eef07c..753d969b0 100644 --- a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx +++ b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx @@ -100,6 +100,16 @@ const NotificationsEnabled = () => ( ); +const NotificationsDenied = () => ( +
+ Notifications are blocked on your device + To enable push notifications from {window.location.hostname.toString()} access your browser + permissions for this site and turn on notifications. Then reload this page to apply your updated + settings on this site. + Learn more. +
+); + export const BrowserNotifyModal = () => { const [error, setError] = useState(null); const accessToken = useRecoilValue(accessTokenAtom); @@ -107,7 +117,9 @@ export const BrowserNotifyModal = () => { const [browserPushPermissionsPending, setBrowserPushPermissionsPending] = useState(false); const notificationsPermitted = - arePushNotificationSupported() && Notification.permission !== 'default'; + arePushNotificationSupported() && Notification.permission === 'granted'; + const notificationsDenied = + arePushNotificationSupported() && Notification.permission === 'denied'; const { notifications } = config; const { browser } = notifications; @@ -121,6 +133,10 @@ export const BrowserNotifyModal = () => { return ; } + if (notificationsDenied) { + return ; + } + if (isMobileSafariIos() && !isMobileSafariHomeScreenApp()) { return ; }