Skip to content

Commit

Permalink
Cherry picking mattermost#6765
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmisasi committed Oct 13, 2020
1 parent 859d7cb commit 5ea49bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions components/purchase_modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions';
import {Stripe} from '@stripe/stripe-js';

import {getCloudProducts} from 'mattermost-redux/actions/cloud';

import {
getClientConfig,
} from 'mattermost-redux/actions/general';
import {getCloudProducts, getCloudSubscription} from 'mattermost-redux/actions/cloud';
import {getClientConfig} from 'mattermost-redux/actions/general';

import {BillingDetails} from 'types/cloud/sku';

Expand All @@ -38,6 +35,7 @@ type Actions = {
getCloudProducts: () => void;
completeStripeAddPaymentMethod: (stripe: Stripe, billingDetails: BillingDetails, isDevMode: boolean) => Promise<boolean | null>;
getClientConfig: () => void;
getCloudSubscription: () => void;
}

function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
Expand All @@ -48,6 +46,7 @@ function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
getCloudProducts,
completeStripeAddPaymentMethod,
getClientConfig,
getCloudSubscription,
},
dispatch,
),
Expand Down
6 changes: 5 additions & 1 deletion components/purchase_modal/purchase_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Props = {
getCloudProducts: () => void;
completeStripeAddPaymentMethod: (stripe: Stripe, billingDetails: BillingDetails, isDevMode: boolean) => Promise<boolean | null>;
getClientConfig: () => void;
getCloudSubscription: () => void;
};
}

Expand Down Expand Up @@ -245,7 +246,10 @@ export default class PurchaseModal extends React.PureComponent<Props, State> {
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});
}}
Expand Down

0 comments on commit 5ea49bc

Please sign in to comment.