diff options
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 20 |
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 @@ | |||
1 | import { remote, ipcRenderer, shell } from 'electron'; | 1 | import { remote, ipcRenderer, shell } from 'electron'; |
2 | import { | 2 | import { |
3 | action, computed, observable, reaction, | 3 | action, computed, observable, |
4 | } from 'mobx'; | 4 | } from 'mobx'; |
5 | import moment from 'moment'; | 5 | import moment from 'moment'; |
6 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 6 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
@@ -17,7 +17,6 @@ import Request from './lib/Request'; | |||
17 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; | 17 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; |
18 | import { isMac } from '../environment'; | 18 | import { isMac } from '../environment'; |
19 | import locales from '../i18n/translations'; | 19 | import locales from '../i18n/translations'; |
20 | import { gaEvent, gaPage, statsEvent } from '../lib/analytics'; | ||
21 | import { onVisibilityChange } from '../helpers/visibility-helper'; | 20 | import { onVisibilityChange } from '../helpers/visibility-helper'; |
22 | import { getLocale } from '../helpers/i18n-helpers'; | 21 | import { getLocale } from '../helpers/i18n-helpers'; |
23 | 22 | ||
@@ -25,7 +24,7 @@ import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '.. | |||
25 | import { isValidExternalURL } from '../helpers/url-helpers'; | 24 | import { isValidExternalURL } from '../helpers/url-helpers'; |
26 | import { sleep } from '../helpers/async-helpers'; | 25 | import { sleep } from '../helpers/async-helpers'; |
27 | 26 | ||
28 | const debug = require('debug')('Franz:AppStore'); | 27 | const debug = require('debug')('Ferdi:AppStore'); |
29 | 28 | ||
30 | const { | 29 | const { |
31 | app, systemPreferences, screen, powerMonitor, | 30 | app, systemPreferences, screen, powerMonitor, |
@@ -35,7 +34,7 @@ const mainWindow = remote.getCurrentWindow(); | |||
35 | 34 | ||
36 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; | 35 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; |
37 | const autoLauncher = new AutoLaunch({ | 36 | const autoLauncher = new AutoLaunch({ |
38 | name: 'Franz', | 37 | name: 'Ferdi', |
39 | }); | 38 | }); |
40 | 39 | ||
41 | const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; | 40 | const 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 }); |