diff options
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 0398b7533..40d98cf42 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 { app, systemPreferences, screen } = remote; | 29 | const { app, systemPreferences, screen } = remote; |
31 | 30 | ||
@@ -33,7 +32,7 @@ const mainWindow = remote.getCurrentWindow(); | |||
33 | 32 | ||
34 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; | 33 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; |
35 | const autoLauncher = new AutoLaunch({ | 34 | const autoLauncher = new AutoLaunch({ |
36 | name: 'Franz', | 35 | name: 'Ferdi', |
37 | }); | 36 | }); |
38 | 37 | ||
39 | export default class AppStore extends Store { | 38 | export default class AppStore extends Store { |
@@ -55,6 +54,8 @@ export default class AppStore extends Store { | |||
55 | 54 | ||
56 | @observable isOnline = navigator.onLine; | 55 | @observable isOnline = navigator.onLine; |
57 | 56 | ||
57 | @observable authRequestFailed = false; | ||
58 | |||
58 | @observable timeOfflineStart; | 59 | @observable timeOfflineStart; |
59 | 60 | ||
60 | @observable updateStatus = null; | 61 | @observable updateStatus = null; |
@@ -114,7 +115,7 @@ export default class AppStore extends Store { | |||
114 | 115 | ||
115 | this.isOnline = navigator.onLine; | 116 | this.isOnline = navigator.onLine; |
116 | 117 | ||
117 | // Check if Franz should launch on start | 118 | // Check if Ferdi should launch on start |
118 | // Needs to be delayed a bit | 119 | // Needs to be delayed a bit |
119 | this._autoStart(); | 120 | this._autoStart(); |
120 | 121 | ||
@@ -174,13 +175,6 @@ export default class AppStore extends Store { | |||
174 | 175 | ||
175 | debug('Window is visible/focused', isVisible); | 176 | debug('Window is visible/focused', isVisible); |
176 | }); | 177 | }); |
177 | |||
178 | // analytics autorun | ||
179 | reaction(() => this.stores.router.location.pathname, (pathname) => { | ||
180 | gaPage(pathname); | ||
181 | }); | ||
182 | |||
183 | statsEvent('app-start'); | ||
184 | } | 178 | } |
185 | 179 | ||
186 | @computed get cacheSize() { | 180 | @computed get cacheSize() { |
@@ -268,8 +262,6 @@ export default class AppStore extends Store { | |||
268 | } catch (err) { | 262 | } catch (err) { |
269 | console.warn(err); | 263 | console.warn(err); |
270 | } | 264 | } |
271 | |||
272 | gaEvent('App', enable ? 'enable autostart' : 'disable autostart'); | ||
273 | } | 265 | } |
274 | 266 | ||
275 | @action _openExternalUrl({ url }) { | 267 | @action _openExternalUrl({ url }) { |
@@ -279,8 +271,6 @@ export default class AppStore extends Store { | |||
279 | if (isValidExternalURL(url)) { | 271 | if (isValidExternalURL(url)) { |
280 | shell.openExternal(url); | 272 | shell.openExternal(url); |
281 | } | 273 | } |
282 | |||
283 | gaEvent('External URL', 'open', parsedUrl.host); | ||
284 | } | 274 | } |
285 | 275 | ||
286 | @action _checkForUpdates() { | 276 | @action _checkForUpdates() { |
@@ -376,7 +366,7 @@ export default class AppStore extends Store { | |||
376 | } | 366 | } |
377 | 367 | ||
378 | _muteAppHandler() { | 368 | _muteAppHandler() { |
379 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; | 369 | const { showMessageBadgesEvenWhenMuted } = this.stores.ui; |
380 | 370 | ||
381 | if (!showMessageBadgesEvenWhenMuted) { | 371 | if (!showMessageBadgesEvenWhenMuted) { |
382 | this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); | 372 | this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); |