diff options
author | 2019-10-17 14:12:36 +0200 | |
---|---|---|
committer | 2019-10-17 14:12:36 +0200 | |
commit | b6276bd0cb88ce681bc35a6fc7b1ae0cf6ac56ea (patch) | |
tree | 7070d5c2fd4a3d98d63d0c85171d85dba77102c5 /src/containers/auth/PricingScreen.js | |
parent | polishing (diff) | |
download | ferdium-app-b6276bd0cb88ce681bc35a6fc7b1ae0cf6ac56ea.tar.gz ferdium-app-b6276bd0cb88ce681bc35a6fc7b1ae0cf6ac56ea.tar.zst ferdium-app-b6276bd0cb88ce681bc35a6fc7b1ae0cf6ac56ea.zip |
optimize trial signup flow
Diffstat (limited to 'src/containers/auth/PricingScreen.js')
-rw-r--r-- | src/containers/auth/PricingScreen.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js index ff378bd8b..55811ed23 100644 --- a/src/containers/auth/PricingScreen.js +++ b/src/containers/auth/PricingScreen.js | |||
@@ -20,14 +20,19 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend | |||
20 | } = this.props; | 20 | } = this.props; |
21 | 21 | ||
22 | const { activateTrialRequest } = stores.user; | 22 | const { activateTrialRequest } = stores.user; |
23 | const { defaultTrialPlan } = stores.features.features; | 23 | const { defaultTrialPlan, canSkipTrial } = stores.features.anonymousFeatures; |
24 | 24 | ||
25 | actions.user.activateTrial({ planId: defaultTrialPlan }); | 25 | if (!canSkipTrial) { |
26 | await activateTrialRequest._promise; | ||
27 | |||
28 | if (!activateTrialRequest.isError) { | ||
29 | stores.router.push('/'); | 26 | stores.router.push('/'); |
30 | stores.user.hasCompletedSignup = true; | 27 | stores.user.hasCompletedSignup = true; |
28 | } else { | ||
29 | actions.user.activateTrial({ planId: defaultTrialPlan }); | ||
30 | await activateTrialRequest._promise; | ||
31 | |||
32 | if (!activateTrialRequest.isError) { | ||
33 | stores.router.push('/'); | ||
34 | stores.user.hasCompletedSignup = true; | ||
35 | } | ||
31 | } | 36 | } |
32 | } | 37 | } |
33 | 38 | ||
@@ -43,7 +48,7 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend | |||
43 | const { pricingConfig } = features; | 48 | const { pricingConfig } = features; |
44 | 49 | ||
45 | let currency = '$'; | 50 | let currency = '$'; |
46 | let price = '5.99'; | 51 | let price = 5.99; |
47 | if (pricingConfig) { | 52 | if (pricingConfig) { |
48 | ({ currency } = pricingConfig); | 53 | ({ currency } = pricingConfig); |
49 | ({ price } = pricingConfig.plans.pro.yearly); | 54 | ({ price } = pricingConfig.plans.pro.yearly); |