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, 5 insertions, 15 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 315235ba4..61b63d52e 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
@@ -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 });