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 315235ba4..5bae6e8d4 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,14 +17,13 @@ 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 | ||
24 | import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; | 23 | import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; |
25 | import { isValidExternalURL } from '../helpers/url-helpers'; | 24 | import { isValidExternalURL } from '../helpers/url-helpers'; |
26 | 25 | ||
27 | const debug = require('debug')('Franz:AppStore'); | 26 | const debug = require('debug')('Ferdi:AppStore'); |
28 | 27 | ||
29 | const { app, systemPreferences, screen } = remote; | 28 | const { app, systemPreferences, screen } = remote; |
30 | 29 | ||
@@ -32,7 +31,7 @@ const mainWindow = remote.getCurrentWindow(); | |||
32 | 31 | ||
33 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; | 32 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; |
34 | const autoLauncher = new AutoLaunch({ | 33 | const autoLauncher = new AutoLaunch({ |
35 | name: 'Franz', | 34 | name: 'Ferdi', |
36 | }); | 35 | }); |
37 | 36 | ||
38 | export default class AppStore extends Store { | 37 | export default class AppStore extends Store { |
@@ -54,6 +53,8 @@ export default class AppStore extends Store { | |||
54 | 53 | ||
55 | @observable isOnline = navigator.onLine; | 54 | @observable isOnline = navigator.onLine; |
56 | 55 | ||
56 | @observable authRequestFailed = false; | ||
57 | |||
57 | @observable timeOfflineStart; | 58 | @observable timeOfflineStart; |
58 | 59 | ||
59 | @observable updateStatus = null; | 60 | @observable updateStatus = null; |
@@ -113,7 +114,7 @@ export default class AppStore extends Store { | |||
113 | 114 | ||
114 | this.isOnline = navigator.onLine; | 115 | this.isOnline = navigator.onLine; |
115 | 116 | ||
116 | // Check if Franz should launch on start | 117 | // Check if Ferdi should launch on start |
117 | // Needs to be delayed a bit | 118 | // Needs to be delayed a bit |
118 | this._autoStart(); | 119 | this._autoStart(); |
119 | 120 | ||
@@ -173,13 +174,6 @@ export default class AppStore extends Store { | |||
173 | 174 | ||
174 | debug('Window is visible/focused', isVisible); | 175 | debug('Window is visible/focused', isVisible); |
175 | }); | 176 | }); |
176 | |||
177 | // analytics autorun | ||
178 | reaction(() => this.stores.router.location.pathname, (pathname) => { | ||
179 | gaPage(pathname); | ||
180 | }); | ||
181 | |||
182 | statsEvent('app-start'); | ||
183 | } | 177 | } |
184 | 178 | ||
185 | @computed get cacheSize() { | 179 | @computed get cacheSize() { |
@@ -267,8 +261,6 @@ export default class AppStore extends Store { | |||
267 | } catch (err) { | 261 | } catch (err) { |
268 | console.warn(err); | 262 | console.warn(err); |
269 | } | 263 | } |
270 | |||
271 | gaEvent('App', enable ? 'enable autostart' : 'disable autostart'); | ||
272 | } | 264 | } |
273 | 265 | ||
274 | @action _openExternalUrl({ url }) { | 266 | @action _openExternalUrl({ url }) { |
@@ -278,8 +270,6 @@ export default class AppStore extends Store { | |||
278 | if (isValidExternalURL(url)) { | 270 | if (isValidExternalURL(url)) { |
279 | shell.openExternal(url); | 271 | shell.openExternal(url); |
280 | } | 272 | } |
281 | |||
282 | gaEvent('External URL', 'open', parsedUrl.host); | ||
283 | } | 273 | } |
284 | 274 | ||
285 | @action _checkForUpdates() { | 275 | @action _checkForUpdates() { |
@@ -373,7 +363,7 @@ export default class AppStore extends Store { | |||
373 | } | 363 | } |
374 | 364 | ||
375 | _muteAppHandler() { | 365 | _muteAppHandler() { |
376 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; | 366 | const { showMessageBadgesEvenWhenMuted } = this.stores.ui; |
377 | 367 | ||
378 | if (!showMessageBadgesEvenWhenMuted) { | 368 | if (!showMessageBadgesEvenWhenMuted) { |
379 | this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); | 369 | this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); |