diff options
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/delayApp/Component.js | 14 | ||||
-rw-r--r-- | src/features/delayApp/index.js | 7 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/features/delayApp/Component.js b/src/features/delayApp/Component.js index 6e0532c9a..ff84510e8 100644 --- a/src/features/delayApp/Component.js +++ b/src/features/delayApp/Component.js | |||
@@ -4,6 +4,8 @@ import { inject, observer } from 'mobx-react'; | |||
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
5 | import injectSheet from 'react-jss'; | 5 | import injectSheet from 'react-jss'; |
6 | 6 | ||
7 | import { gaEvent } from '../../lib/analytics'; | ||
8 | |||
7 | import Button from '../../components/ui/Button'; | 9 | import Button from '../../components/ui/Button'; |
8 | 10 | ||
9 | import { config } from '.'; | 11 | import { config } from '.'; |
@@ -59,8 +61,16 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp | |||
59 | clearInterval(this.countdownInterval); | 61 | clearInterval(this.countdownInterval); |
60 | } | 62 | } |
61 | 63 | ||
64 | handleCTAClick() { | ||
65 | const { actions } = this.props; | ||
66 | |||
67 | actions.ui.openSettings({ path: 'user' }); | ||
68 | |||
69 | gaEvent('DelayApp', 'subscribe_click', 'Delay App Feature'); | ||
70 | } | ||
71 | |||
62 | render() { | 72 | render() { |
63 | const { classes, actions } = this.props; | 73 | const { classes } = this.props; |
64 | const { intl } = this.context; | 74 | const { intl } = this.context; |
65 | 75 | ||
66 | return ( | 76 | return ( |
@@ -70,7 +80,7 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp | |||
70 | label={intl.formatMessage(messages.action)} | 80 | label={intl.formatMessage(messages.action)} |
71 | className={classes.button} | 81 | className={classes.button} |
72 | buttonType="inverted" | 82 | buttonType="inverted" |
73 | onClick={() => actions.ui.openSettings({ path: 'user' })} | 83 | onClick={this.handleCTAClick.bind(this)} |
74 | /> | 84 | /> |
75 | <p className="footnote"> | 85 | <p className="footnote"> |
76 | {intl.formatMessage(messages.text, { | 86 | {intl.formatMessage(messages.text, { |
diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index d5c544b78..d7e8252f3 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js | |||
@@ -3,6 +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 | 7 | ||
7 | const debug = require('debug')('Franz:feature:delayApp'); | 8 | const debug = require('debug')('Franz:feature:delayApp'); |
8 | 9 | ||
@@ -40,6 +41,11 @@ export default function init(stores) { | |||
40 | config.delayDuration = globalConfig.wait !== undefined ? globalConfig.wait : DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait; | 41 | config.delayDuration = globalConfig.wait !== undefined ? globalConfig.wait : DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait; |
41 | 42 | ||
42 | autorun(() => { | 43 | autorun(() => { |
44 | if (stores.user.data.isPremium) { | ||
45 | debug('Skipping app delay as user is Premium Supporter'); | ||
46 | return; | ||
47 | } | ||
48 | |||
43 | if (stores.services.all.length === 0) { | 49 | if (stores.services.all.length === 0) { |
44 | shownAfterLaunch = true; | 50 | shownAfterLaunch = true; |
45 | return; | 51 | return; |
@@ -50,6 +56,7 @@ export default function init(stores) { | |||
50 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); | 56 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); |
51 | 57 | ||
52 | setVisibility(true); | 58 | setVisibility(true); |
59 | gaEvent('delayApp', 'show', 'Delay App Feature'); | ||
53 | 60 | ||
54 | timeLastDelay = moment(); | 61 | timeLastDelay = moment(); |
55 | shownAfterLaunch = true; | 62 | shownAfterLaunch = true; |