diff options
author | vantezzen <hello@vantezzen.io> | 2019-10-24 15:15:42 +0200 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-10-24 15:15:42 +0200 |
commit | 54f8b191a94bd78a85b046bbf21dd2245d3a6f3e (patch) | |
tree | ada5876f0e8a697ba4693bba07f5e0f31fea1fc9 /src/containers/settings | |
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/settings')
-rw-r--r-- | src/containers/settings/AccountScreen.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index 41cdeb79a..93ab44690 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -5,6 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import PaymentStore from '../../stores/PaymentStore'; | 5 | import PaymentStore from '../../stores/PaymentStore'; |
6 | import UserStore from '../../stores/UserStore'; | 6 | import UserStore from '../../stores/UserStore'; |
7 | import AppStore from '../../stores/AppStore'; | 7 | import AppStore from '../../stores/AppStore'; |
8 | import FeaturesStore from '../../stores/FeaturesStore'; | ||
8 | 9 | ||
9 | import AccountDashboard from '../../components/settings/account/AccountDashboard'; | 10 | import AccountDashboard from '../../components/settings/account/AccountDashboard'; |
10 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 11 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
@@ -12,8 +13,9 @@ import { WEBSITE } from '../../environment'; | |||
12 | 13 | ||
13 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { | 14 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { |
14 | onCloseWindow() { | 15 | onCloseWindow() { |
15 | const { user } = this.props.stores; | 16 | const { user, features } = this.props.stores; |
16 | user.getUserInfoRequest.invalidate({ immediately: true }); | 17 | user.getUserInfoRequest.invalidate({ immediately: true }); |
18 | features.featuresRequest.invalidate({ immediately: true }); | ||
17 | } | 19 | } |
18 | 20 | ||
19 | reloadData() { | 21 | reloadData() { |
@@ -39,12 +41,17 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend | |||
39 | } | 41 | } |
40 | 42 | ||
41 | render() { | 43 | render() { |
42 | const { user, payment } = this.props.stores; | 44 | const { user, payment, features } = this.props.stores; |
43 | const { user: userActions } = this.props.actions; | 45 | const { |
46 | user: userActions, | ||
47 | payment: paymentActions, | ||
48 | } = this.props.actions; | ||
44 | 49 | ||
45 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; | 50 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; |
46 | const isLoadingPlans = payment.plansRequest.isExecuting; | 51 | const isLoadingPlans = payment.plansRequest.isExecuting; |
47 | 52 | ||
53 | const { upgradeAccount } = paymentActions; | ||
54 | |||
48 | return ( | 55 | return ( |
49 | <ErrorBoundary> | 56 | <ErrorBoundary> |
50 | <AccountDashboard | 57 | <AccountDashboard |
@@ -60,7 +67,7 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend | |||
60 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} | 67 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} |
61 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} | 68 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} |
62 | openEditAccount={() => this.handleWebsiteLink('/user/profile')} | 69 | openEditAccount={() => this.handleWebsiteLink('/user/profile')} |
63 | upgradeToPro={() => this.handleWebsiteLink('/inapp/user/licenses')} | 70 | upgradeToPro={() => upgradeAccount({ planId: features.features.pricingConfig.plans.pro.yearly.id })} |
64 | openBilling={() => this.handleWebsiteLink('/user/billing')} | 71 | openBilling={() => this.handleWebsiteLink('/user/billing')} |
65 | openInvoices={() => this.handleWebsiteLink('/user/invoices')} | 72 | openInvoices={() => this.handleWebsiteLink('/user/invoices')} |
66 | /> | 73 | /> |
@@ -72,12 +79,14 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend | |||
72 | AccountScreen.wrappedComponent.propTypes = { | 79 | AccountScreen.wrappedComponent.propTypes = { |
73 | stores: PropTypes.shape({ | 80 | stores: PropTypes.shape({ |
74 | user: PropTypes.instanceOf(UserStore).isRequired, | 81 | user: PropTypes.instanceOf(UserStore).isRequired, |
82 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | ||
75 | payment: PropTypes.instanceOf(PaymentStore).isRequired, | 83 | payment: PropTypes.instanceOf(PaymentStore).isRequired, |
76 | app: PropTypes.instanceOf(AppStore).isRequired, | 84 | app: PropTypes.instanceOf(AppStore).isRequired, |
77 | }).isRequired, | 85 | }).isRequired, |
78 | actions: PropTypes.shape({ | 86 | actions: PropTypes.shape({ |
79 | payment: PropTypes.shape({ | 87 | payment: PropTypes.shape({ |
80 | createDashboardUrl: PropTypes.func.isRequired, | 88 | createDashboardUrl: PropTypes.func.isRequired, |
89 | upgradeAccount: PropTypes.func.isRequired, | ||
81 | }).isRequired, | 90 | }).isRequired, |
82 | app: PropTypes.shape({ | 91 | app: PropTypes.shape({ |
83 | openExternalUrl: PropTypes.func.isRequired, | 92 | openExternalUrl: PropTypes.func.isRequired, |