diff options
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 12 |
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 @@ | |||
1 | import { remote, ipcRenderer, shell } from 'electron'; | 1 | import { remote, ipcRenderer, shell } from 'electron'; |
2 | import { action, computed, observable } from 'mobx'; | 2 | import { |
3 | action, computed, observable, reaction, | ||
4 | } from 'mobx'; | ||
3 | import moment from 'moment'; | 5 | import moment from 'moment'; |
4 | import key from 'keymaster'; | 6 | import key from 'keymaster'; |
5 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 7 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
@@ -11,7 +13,7 @@ import Request from './lib/Request'; | |||
11 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; | 13 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; |
12 | import { isMac, isLinux, isWindows } from '../environment'; | 14 | import { isMac, isLinux, isWindows } from '../environment'; |
13 | import locales from '../i18n/translations'; | 15 | import locales from '../i18n/translations'; |
14 | import { gaEvent } from '../lib/analytics'; | 16 | import { gaEvent, gaPage } from '../lib/analytics'; |
15 | import { onVisibilityChange } from '../helpers/visibility-helper'; | 17 | import { onVisibilityChange } from '../helpers/visibility-helper'; |
16 | import { getLocale } from '../helpers/i18n-helpers'; | 18 | import { 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() { |