From e037b740972e6930d3e6693207db6af094e5813d Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 8 Oct 2019 23:44:15 +0200 Subject: Add macOS catalina notifications hack --- src/stores/AppStore.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/stores') diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 4a00cb294..f102fc370 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -38,6 +38,8 @@ const autoLauncher = new AutoLaunch({ name: 'Franz', }); +const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; + export default class AppStore extends Store { updateStatusTypes = { CHECKING: 'CHECKING', @@ -205,6 +207,18 @@ export default class AppStore extends Store { } }); + // macOS catalina notifications hack + // notifications got stuck after upgrade but forcing a notification + // via `new Notification` triggered the permission request + if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) { + // eslint-disable-next-line no-new + new window.Notification('Welcome to Franz 5', { + body: 'Have a wonderful day & happy messaging.', + }); + + localStorage.setItem(CATALINA_NOTIFICATION_HACK_KEY, true); + } + statsEvent('app-start'); } -- cgit v1.2.3-70-g09d2