diff --git a/components/purchase_modal/index.ts b/components/purchase_modal/index.ts index 4537a4e9e69b..ab26191f3236 100644 --- a/components/purchase_modal/index.ts +++ b/components/purchase_modal/index.ts @@ -7,7 +7,7 @@ import {Stripe} from '@stripe/stripe-js'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import {getCloudProducts} from 'mattermost-redux/actions/cloud'; +import {getCloudProducts, getCloudSubscription} from 'mattermost-redux/actions/cloud'; import {getClientConfig} from 'mattermost-redux/actions/general'; import {GlobalState} from 'types/store'; @@ -37,6 +37,7 @@ type Actions = { getCloudProducts: () => void; completeStripeAddPaymentMethod: (stripe: Stripe, billingDetails: BillingDetails, isDevMode: boolean) => Promise; getClientConfig: () => void; + getCloudSubscription: () => void; } function mapDispatchToProps(dispatch: Dispatch) { @@ -47,6 +48,7 @@ function mapDispatchToProps(dispatch: Dispatch) { getCloudProducts, completeStripeAddPaymentMethod, getClientConfig, + getCloudSubscription, }, dispatch, ), diff --git a/components/purchase_modal/purchase_modal.tsx b/components/purchase_modal/purchase_modal.tsx index 08bf46e0bfef..46b67d4fc424 100644 --- a/components/purchase_modal/purchase_modal.tsx +++ b/components/purchase_modal/purchase_modal.tsx @@ -43,6 +43,7 @@ type Props = { getCloudProducts: () => void; completeStripeAddPaymentMethod: (stripe: Stripe, billingDetails: BillingDetails, isDevMode: boolean) => Promise; getClientConfig: () => void; + getCloudSubscription: () => void; }; } @@ -250,7 +251,10 @@ export default class PurchaseModal extends React.PureComponent { this.props.actions.completeStripeAddPaymentMethod } isDevMode={this.props.isDevMode} - onClose={this.props.actions.closeModal} + onClose={() => { + this.props.actions.getCloudSubscription(); + this.props.actions.closeModal(); + }} onBack={() => { this.setState({processing: false}); }}