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.js20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 0a6309092..6ce79f2e2 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -1,6 +1,6 @@
1import { remote, ipcRenderer, shell } from 'electron'; 1import { remote, ipcRenderer, shell } from 'electron';
2import { 2import {
3 action, computed, observable, reaction, 3 action, computed, observable,
4} from 'mobx'; 4} from 'mobx';
5import moment from 'moment'; 5import moment from 'moment';
6import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 6import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
@@ -17,7 +17,6 @@ import Request from './lib/Request';
17import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; 17import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
18import { isMac } from '../environment'; 18import { isMac } from '../environment';
19import locales from '../i18n/translations'; 19import locales from '../i18n/translations';
20import { gaEvent, gaPage, statsEvent } from '../lib/analytics';
21import { onVisibilityChange } from '../helpers/visibility-helper'; 20import { onVisibilityChange } from '../helpers/visibility-helper';
22import { getLocale } from '../helpers/i18n-helpers'; 21import { getLocale } from '../helpers/i18n-helpers';
23 22
@@ -25,7 +24,7 @@ import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '..
25import { isValidExternalURL } from '../helpers/url-helpers'; 24import { isValidExternalURL } from '../helpers/url-helpers';
26import { sleep } from '../helpers/async-helpers'; 25import { sleep } from '../helpers/async-helpers';
27 26
28const debug = require('debug')('Franz:AppStore'); 27const debug = require('debug')('Ferdi:AppStore');
29 28
30const { 29const {
31 app, systemPreferences, screen, powerMonitor, 30 app, systemPreferences, screen, powerMonitor,
@@ -35,7 +34,7 @@ const mainWindow = remote.getCurrentWindow();
35 34
36const defaultLocale = DEFAULT_APP_SETTINGS.locale; 35const defaultLocale = DEFAULT_APP_SETTINGS.locale;
37const autoLauncher = new AutoLaunch({ 36const autoLauncher = new AutoLaunch({
38 name: 'Franz', 37 name: 'Ferdi',
39}); 38});
40 39
41const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; 40const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions';
@@ -59,6 +58,8 @@ export default class AppStore extends Store {
59 58
60 @observable isOnline = navigator.onLine; 59 @observable isOnline = navigator.onLine;
61 60
61 @observable authRequestFailed = false;
62
62 @observable timeSuspensionStart; 63 @observable timeSuspensionStart;
63 64
64 @observable timeOfflineStart; 65 @observable timeOfflineStart;
@@ -123,7 +124,7 @@ export default class AppStore extends Store {
123 124
124 this.isOnline = navigator.onLine; 125 this.isOnline = navigator.onLine;
125 126
126 // Check if Franz should launch on start 127 // Check if Ferdi should launch on start
127 // Needs to be delayed a bit 128 // Needs to be delayed a bit
128 this._autoStart(); 129 this._autoStart();
129 130
@@ -190,11 +191,6 @@ export default class AppStore extends Store {
190 debug('Window is visible/focused', isVisible); 191 debug('Window is visible/focused', isVisible);
191 }); 192 });
192 193
193 // analytics autorun
194 reaction(() => this.stores.router.location.pathname, (pathname) => {
195 gaPage(pathname);
196 });
197
198 powerMonitor.on('suspend', () => { 194 powerMonitor.on('suspend', () => {
199 debug('System suspended starting timer'); 195 debug('System suspended starting timer');
200 196
@@ -315,8 +311,6 @@ export default class AppStore extends Store {
315 } catch (err) { 311 } catch (err) {
316 console.warn(err); 312 console.warn(err);
317 } 313 }
318
319 gaEvent('App', enable ? 'enable autostart' : 'disable autostart');
320 } 314 }
321 315
322 @action _openExternalUrl({ url }) { 316 @action _openExternalUrl({ url }) {
@@ -421,7 +415,7 @@ export default class AppStore extends Store {
421 } 415 }
422 416
423 _muteAppHandler() { 417 _muteAppHandler() {
424 const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; 418 const { showMessageBadgesEvenWhenMuted } = this.stores.ui;
425 419
426 if (!showMessageBadgesEvenWhenMuted) { 420 if (!showMessageBadgesEvenWhenMuted) {
427 this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); 421 this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 });