diff options
author | 2021-08-13 00:45:01 +0530 | |
---|---|---|
committer | 2021-08-13 00:45:01 +0530 | |
commit | 2d27d5e66649d4f5baf127a53ee5ae524eae3a59 (patch) | |
tree | c592ea219ac8cd987fc367f57b54034c450ab2ab /src/containers/settings/AccountScreen.js | |
parent | Ferdi v5.6.0 (diff) | |
parent | 5.6.1-nightly.24 [skip ci] (diff) | |
download | ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.gz ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.zst ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.zip |
chore: merge from nightly branch into release branch in prep for next beta
Diffstat (limited to 'src/containers/settings/AccountScreen.js')
-rw-r--r-- | src/containers/settings/AccountScreen.js | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index db3b2a4a7..8d92b01be 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -2,7 +2,6 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | 4 | ||
5 | import PaymentStore from '../../stores/PaymentStore'; | ||
6 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
7 | import AppStore from '../../stores/AppStore'; | 6 | import AppStore from '../../stores/AppStore'; |
8 | import FeaturesStore from '../../stores/FeaturesStore'; | 7 | import FeaturesStore from '../../stores/FeaturesStore'; |
@@ -24,10 +23,9 @@ class AccountScreen extends Component { | |||
24 | } | 23 | } |
25 | 24 | ||
26 | reloadData() { | 25 | reloadData() { |
27 | const { user, payment } = this.props.stores; | 26 | const { user } = this.props.stores; |
28 | 27 | ||
29 | user.getUserInfoRequest.reload(); | 28 | user.getUserInfoRequest.reload(); |
30 | payment.plansRequest.reload(); | ||
31 | } | 29 | } |
32 | 30 | ||
33 | handleWebsiteLink(route) { | 31 | handleWebsiteLink(route) { |
@@ -48,28 +46,17 @@ class AccountScreen extends Component { | |||
48 | } | 46 | } |
49 | 47 | ||
50 | render() { | 48 | render() { |
51 | const { | 49 | const { user, settings } = this.props.stores; |
52 | user, | 50 | const { user: userActions } = this.props.actions; |
53 | payment, | ||
54 | features, | ||
55 | settings, | ||
56 | } = this.props.stores; | ||
57 | const { user: userActions, payment: paymentActions } = this.props.actions; | ||
58 | 51 | ||
59 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; | 52 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; |
60 | const isLoadingPlans = payment.plansRequest.isExecuting; | ||
61 | |||
62 | const { upgradeAccount } = paymentActions; | ||
63 | 53 | ||
64 | return ( | 54 | return ( |
65 | <ErrorBoundary> | 55 | <ErrorBoundary> |
66 | <AccountDashboard | 56 | <AccountDashboard |
67 | server={settings.all.app.server} | 57 | server={settings.all.app.server} |
68 | user={user.data} | 58 | user={user.data} |
69 | isPremiumOverrideUser={user.isPremiumOverride} | ||
70 | isProUser={user.isPro} | ||
71 | isLoading={isLoadingUserInfo} | 59 | isLoading={isLoadingUserInfo} |
72 | isLoadingPlans={isLoadingPlans} | ||
73 | userInfoRequestFailed={ | 60 | userInfoRequestFailed={ |
74 | user.getUserInfoRequest.wasExecuted | 61 | user.getUserInfoRequest.wasExecuted |
75 | && user.getUserInfoRequest.isError | 62 | && user.getUserInfoRequest.isError |
@@ -83,10 +70,6 @@ class AccountScreen extends Component { | |||
83 | && !user.deleteAccountRequest.isError | 70 | && !user.deleteAccountRequest.isError |
84 | } | 71 | } |
85 | openEditAccount={() => this.handleWebsiteLink('/user/profile')} | 72 | openEditAccount={() => this.handleWebsiteLink('/user/profile')} |
86 | upgradeToPro={() => upgradeAccount({ | ||
87 | planId: features.features.pricingConfig.plans.pro.yearly.id, | ||
88 | })} | ||
89 | openBilling={() => this.handleWebsiteLink('/user/billing')} | ||
90 | openInvoices={() => this.handleWebsiteLink('/user/invoices')} | 73 | openInvoices={() => this.handleWebsiteLink('/user/invoices')} |
91 | /> | 74 | /> |
92 | </ErrorBoundary> | 75 | </ErrorBoundary> |
@@ -98,12 +81,10 @@ AccountScreen.wrappedComponent.propTypes = { | |||
98 | stores: PropTypes.shape({ | 81 | stores: PropTypes.shape({ |
99 | user: PropTypes.instanceOf(UserStore).isRequired, | 82 | user: PropTypes.instanceOf(UserStore).isRequired, |
100 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | 83 | features: PropTypes.instanceOf(FeaturesStore).isRequired, |
101 | payment: PropTypes.instanceOf(PaymentStore).isRequired, | ||
102 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | 84 | settings: PropTypes.instanceOf(SettingsStore).isRequired, |
103 | app: PropTypes.instanceOf(AppStore).isRequired, | 85 | app: PropTypes.instanceOf(AppStore).isRequired, |
104 | }).isRequired, | 86 | }).isRequired, |
105 | actions: PropTypes.shape({ | 87 | actions: PropTypes.shape({ |
106 | payment: PropTypes.instanceOf(PaymentStore).isRequired, | ||
107 | app: PropTypes.instanceOf(AppStore).isRequired, | 88 | app: PropTypes.instanceOf(AppStore).isRequired, |
108 | user: PropTypes.instanceOf(UserStore).isRequired, | 89 | user: PropTypes.instanceOf(UserStore).isRequired, |
109 | }).isRequired, | 90 | }).isRequired, |