diff options
Diffstat (limited to 'src/features/delayApp/index.js')
-rw-r--r-- | src/features/delayApp/index.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index 28aa50eb2..abc8274cf 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js | |||
@@ -3,7 +3,7 @@ import moment from 'moment'; | |||
3 | import DelayAppComponent from './Component'; | 3 | import DelayAppComponent from './Component'; |
4 | 4 | ||
5 | import { DEFAULT_FEATURES_CONFIG } from '../../config'; | 5 | import { DEFAULT_FEATURES_CONFIG } from '../../config'; |
6 | import { gaEvent } from '../../lib/analytics'; | 6 | import { gaEvent, gaPage } from '../../lib/analytics'; |
7 | 7 | ||
8 | const debug = require('debug')('Franz:feature:delayApp'); | 8 | const debug = require('debug')('Franz:feature:delayApp'); |
9 | 9 | ||
@@ -28,8 +28,12 @@ export default function init(stores) { | |||
28 | let shownAfterLaunch = false; | 28 | let shownAfterLaunch = false; |
29 | let timeLastDelay = moment(); | 29 | let timeLastDelay = moment(); |
30 | 30 | ||
31 | window.franz.features.delayApp = { | ||
32 | state, | ||
33 | }; | ||
34 | |||
31 | reaction( | 35 | reaction( |
32 | () => stores.features.features.needToWaitToProceed && !stores.user.data.isPremium, | 36 | () => stores.user.isLoggedIn && stores.features.features.needToWaitToProceed && !stores.user.data.isPremium, |
33 | (isEnabled) => { | 37 | (isEnabled) => { |
34 | if (isEnabled) { | 38 | if (isEnabled) { |
35 | debug('Enabling `delayApp` feature'); | 39 | debug('Enabling `delayApp` feature'); |
@@ -50,6 +54,7 @@ export default function init(stores) { | |||
50 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); | 54 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); |
51 | 55 | ||
52 | setVisibility(true); | 56 | setVisibility(true); |
57 | gaPage('/delayApp'); | ||
53 | gaEvent('delayApp', 'show', 'Delay App Feature'); | 58 | gaEvent('delayApp', 'show', 'Delay App Feature'); |
54 | 59 | ||
55 | timeLastDelay = moment(); | 60 | timeLastDelay = moment(); |