diff options
author | 2019-10-24 15:15:42 +0200 | |
---|---|---|
committer | 2019-10-24 15:15:42 +0200 | |
commit | 54f8b191a94bd78a85b046bbf21dd2245d3a6f3e (patch) | |
tree | ada5876f0e8a697ba4693bba07f5e0f31fea1fc9 /src/containers/auth/PricingScreen.js | |
parent | Update submodules (diff) | |
parent | bump version to 5.4.0 (diff) | |
download | ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.gz ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.zst ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.zip |
Merge https://github.com/meetfranz/franz into franz-5.4.0-release
Diffstat (limited to 'src/containers/auth/PricingScreen.js')
-rw-r--r-- | src/containers/auth/PricingScreen.js | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js index af1651931..21c859c12 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 | ||
@@ -37,8 +42,17 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend | |||
37 | stores, | 42 | stores, |
38 | } = this.props; | 43 | } = this.props; |
39 | 44 | ||
40 | const { getUserInfoRequest, activateTrialRequest } = stores.user; | 45 | const { getUserInfoRequest, activateTrialRequest, data } = stores.user; |
41 | const { featuresRequest } = stores.features; | 46 | const { featuresRequest, features } = stores.features; |
47 | |||
48 | const { pricingConfig } = features; | ||
49 | |||
50 | let currency = '$'; | ||
51 | let price = 5.99; | ||
52 | if (pricingConfig) { | ||
53 | ({ currency } = pricingConfig); | ||
54 | ({ price } = pricingConfig.plans.pro.yearly); | ||
55 | } | ||
42 | 56 | ||
43 | return ( | 57 | return ( |
44 | <Pricing | 58 | <Pricing |
@@ -46,7 +60,11 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend | |||
46 | isLoadingRequiredData={(getUserInfoRequest.isExecuting || !getUserInfoRequest.wasExecuted) || (featuresRequest.isExecuting || !featuresRequest.wasExecuted)} | 60 | isLoadingRequiredData={(getUserInfoRequest.isExecuting || !getUserInfoRequest.wasExecuted) || (featuresRequest.isExecuting || !featuresRequest.wasExecuted)} |
47 | isActivatingTrial={activateTrialRequest.isExecuting} | 61 | isActivatingTrial={activateTrialRequest.isExecuting} |
48 | trialActivationError={activateTrialRequest.isError} | 62 | trialActivationError={activateTrialRequest.isError} |
63 | canSkipTrial={features.canSkipTrial} | ||
49 | error={error} | 64 | error={error} |
65 | currency={currency} | ||
66 | price={price} | ||
67 | name={data.firstname} | ||
50 | /> | 68 | /> |
51 | ); | 69 | ); |
52 | } | 70 | } |