From 778ffe2f81db5f8696bbd8aa1afe295923c6f476 Mon Sep 17 00:00:00 2001 From: Rish Date: Tue, 30 Mar 2021 13:35:27 +0530 Subject: [PATCH] Updated action for continuing a subscription refs https://github.com/TryGhost/Team/issues/530 A continueSubscription action has been added to handle continuing subscriptions as a different flow since we now have `smart_cancel` for the cancellation. The "continue subscription" button in Portal is updated to use the new action to correctly continue a subscription instead of old action which did both cancel and continue. --- ghost/portal/src/components/pages/AccountHomePage.js | 5 ++--- ghost/portal/src/components/pages/AccountPlanPage.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ghost/portal/src/components/pages/AccountHomePage.js b/ghost/portal/src/components/pages/AccountHomePage.js index 7964ab4b29..3482ed669b 100644 --- a/ghost/portal/src/components/pages/AccountHomePage.js +++ b/ghost/portal/src/components/pages/AccountHomePage.js @@ -318,9 +318,8 @@ const CancelContinueSubscription = ({member, onAction, action, brandColor, showO { - onAction('cancelSubscription', { - subscriptionId: subscription.id, - cancelAtPeriodEnd: !subscription.cancel_at_period_end + onAction('continueSubscription', { + subscriptionId: subscription.id }); }} isRunning={isRunning} diff --git a/ghost/portal/src/components/pages/AccountPlanPage.js b/ghost/portal/src/components/pages/AccountPlanPage.js index 150a0234b6..e7333bfd41 100644 --- a/ghost/portal/src/components/pages/AccountPlanPage.js +++ b/ghost/portal/src/components/pages/AccountPlanPage.js @@ -385,9 +385,8 @@ export default class AccountPlanPage extends React.Component { const subscription = getSubscriptionFromId({subscriptionId, member}); const subscriptionPlan = getPlanFromSubscription({subscription}); if (!cancelAtPeriodEnd) { - this.context.onAction('cancelSubscription', { - subscriptionId, - cancelAtPeriodEnd + this.context.onAction('continueSubscription', { + subscriptionId }); } else { this.setState({