aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 593bf341e..da6055e5f 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -52,7 +52,7 @@ export default class AppStore extends Store {
52 52
53 @observable getAppCacheSizeRequest = new Request(this.api.local, 'getAppCacheSize'); 53 @observable getAppCacheSizeRequest = new Request(this.api.local, 'getAppCacheSize');
54 54
55 @observable clearAppCacheRequest = new Request(this.api.local, 'clearAppCache'); 55 @observable clearAppCacheRequest = new Request(this.api.local, 'clearCache');
56 56
57 @observable autoLaunchOnStart = true; 57 @observable autoLaunchOnStart = true;
58 58
@@ -179,6 +179,10 @@ export default class AppStore extends Store {
179 this.stores.router.push(url); 179 this.stores.router.push(url);
180 }); 180 });
181 181
182 ipcRenderer.on('muteApp', () => {
183 this._toggleMuteApp();
184 });
185
182 this.locale = this._getDefaultLocale(); 186 this.locale = this._getDefaultLocale();
183 187
184 setTimeout(() => { 188 setTimeout(() => {
@@ -214,13 +218,16 @@ export default class AppStore extends Store {
214 // macOS catalina notifications hack 218 // macOS catalina notifications hack
215 // notifications got stuck after upgrade but forcing a notification 219 // notifications got stuck after upgrade but forcing a notification
216 // via `new Notification` triggered the permission request 220 // via `new Notification` triggered the permission request
217 if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) { 221 if (isMac) {
218 // eslint-disable-next-line no-new 222 if (!localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) {
219 new window.Notification('Welcome to Franz 5', { 223 debug('Triggering macOS Catalina notification permission trigger');
220 body: 'Have a wonderful day & happy messaging.', 224 // eslint-disable-next-line no-new
221 }); 225 new window.Notification('Welcome to Franz 5', {
226 body: 'Have a wonderful day & happy messaging.',
227 });
222 228
223 localStorage.setItem(CATALINA_NOTIFICATION_HACK_KEY, true); 229 localStorage.setItem(CATALINA_NOTIFICATION_HACK_KEY, true);
230 }
224 } 231 }
225 } 232 }
226 233
@@ -374,8 +381,11 @@ export default class AppStore extends Store {
374 const allServiceIds = await getServiceIdsFromPartitions(); 381 const allServiceIds = await getServiceIdsFromPartitions();
375 const allOrphanedServiceIds = allServiceIds.filter(id => !this.stores.services.all.find(s => id.replace('service-', '') === s.id)); 382 const allOrphanedServiceIds = allServiceIds.filter(id => !this.stores.services.all.find(s => id.replace('service-', '') === s.id));
376 383
377 await Promise.all(allOrphanedServiceIds.map(id => removeServicePartitionDirectory(id))); 384 try {
378 385 await Promise.all(allOrphanedServiceIds.map(id => removeServicePartitionDirectory(id)));
386 } catch (ex) {
387 console.log('Error while deleting service partition directory - ', ex);
388 }
379 await Promise.all(this.stores.services.all.map(s => this.actions.service.clearCache({ serviceId: s.id }))); 389 await Promise.all(this.stores.services.all.map(s => this.actions.service.clearCache({ serviceId: s.id })));
380 390
381 await clearAppCache._promise; 391 await clearAppCache._promise;