aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-10-08 23:44:15 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-10-08 23:44:15 +0200
commite037b740972e6930d3e6693207db6af094e5813d (patch)
tree0cbd9380d7f55d7745921a96f37037f19d6b78f6 /src/stores/AppStore.js
parentfeat(Workspaces): Only load workspace related services (diff)
downloadferdium-app-e037b740972e6930d3e6693207db6af094e5813d.tar.gz
ferdium-app-e037b740972e6930d3e6693207db6af094e5813d.tar.zst
ferdium-app-e037b740972e6930d3e6693207db6af094e5813d.zip
Add macOS catalina notifications hack
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js14
1 files changed, 14 insertions, 0 deletions
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({
38 name: 'Franz', 38 name: 'Franz',
39}); 39});
40 40
41const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions';
42
41export default class AppStore extends Store { 43export default class AppStore extends Store {
42 updateStatusTypes = { 44 updateStatusTypes = {
43 CHECKING: 'CHECKING', 45 CHECKING: 'CHECKING',
@@ -205,6 +207,18 @@ export default class AppStore extends Store {
205 } 207 }
206 }); 208 });
207 209
210 // macOS catalina notifications hack
211 // notifications got stuck after upgrade but forcing a notification
212 // via `new Notification` triggered the permission request
213 if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) {
214 // eslint-disable-next-line no-new
215 new window.Notification('Welcome to Franz 5', {
216 body: 'Have a wonderful day & happy messaging.',
217 });
218
219 localStorage.setItem(CATALINA_NOTIFICATION_HACK_KEY, true);
220 }
221
208 statsEvent('app-start'); 222 statsEvent('app-start');
209 } 223 }
210 224