aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-02-21 15:25:45 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-02-21 15:25:45 +0100
commit71e3d7310a06305c3c15685364ea8e20fc720867 (patch)
tree142ef1cc0ad793ea40cb8ea4f6d5c649cf4e0e3c /src/stores/AppStore.js
parentAdd pageview event (diff)
downloadferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.tar.gz
ferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.tar.zst
ferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.zip
Simplify analytics calls
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index b21d48a11..d90f32744 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -1,5 +1,7 @@
1import { remote, ipcRenderer, shell } from 'electron'; 1import { remote, ipcRenderer, shell } from 'electron';
2import { action, computed, observable } from 'mobx'; 2import {
3 action, computed, observable, reaction,
4} from 'mobx';
3import moment from 'moment'; 5import moment from 'moment';
4import key from 'keymaster'; 6import key from 'keymaster';
5import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 7import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
@@ -11,7 +13,7 @@ import Request from './lib/Request';
11import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; 13import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
12import { isMac, isLinux, isWindows } from '../environment'; 14import { isMac, isLinux, isWindows } from '../environment';
13import locales from '../i18n/translations'; 15import locales from '../i18n/translations';
14import { gaEvent } from '../lib/analytics'; 16import { gaEvent, gaPage } from '../lib/analytics';
15import { onVisibilityChange } from '../helpers/visibility-helper'; 17import { onVisibilityChange } from '../helpers/visibility-helper';
16import { getLocale } from '../helpers/i18n-helpers'; 18import { getLocale } from '../helpers/i18n-helpers';
17 19
@@ -184,6 +186,12 @@ export default class AppStore extends Store {
184 186
185 debug('Window is visible/focused', isVisible); 187 debug('Window is visible/focused', isVisible);
186 }); 188 });
189
190 // analytics autorun
191 reaction(() => this.stores.router.location.pathname, (pathname) => {
192 gaPage(pathname);
193 });
194 console.log('router location', this.stores.router.location);
187 } 195 }
188 196
189 @computed get cacheSize() { 197 @computed get cacheSize() {