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.js24
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 @@
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 { app, systemPreferences, screen } = remote; 29const { app, systemPreferences, screen } = remote;
31 30
@@ -33,7 +32,7 @@ const mainWindow = remote.getCurrentWindow();
33 32
34const defaultLocale = DEFAULT_APP_SETTINGS.locale; 33const defaultLocale = DEFAULT_APP_SETTINGS.locale;
35const autoLauncher = new AutoLaunch({ 34const autoLauncher = new AutoLaunch({
36 name: 'Franz', 35 name: 'Ferdi',
37}); 36});
38 37
39export default class AppStore extends Store { 38export 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 });