From 510dfd75d96afd17ba27d8f17010385f7f72a838 Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Wed, 14 Oct 2020 16:18:09 +0200 Subject: [PATCH] Removed notifications when cancelling Stripe flows no refs. - removed notifications when clicking on the back button Stripe checkout either in update plan or in sign up flows --- ghost/portal/src/App.js | 17 +++++++++++------ ghost/portal/src/utils/notifications.js | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ghost/portal/src/App.js b/ghost/portal/src/App.js index b0aa99ca37..d0abfc9716 100644 --- a/ghost/portal/src/App.js +++ b/ghost/portal/src/App.js @@ -209,13 +209,18 @@ export default class App extends React.Component { fetchNotificationData() { const {type, status, duration, autoHide, closeable} = NotificationParser({billingOnly: true}) || {}; if (['stripe:billing-update'].includes(type)) { - const popupNotification = createPopupNotification({ - type, status, duration, closeable, autoHide, state: this.state, - message: status === 'success' ? 'Billing info updated successfully' : 'Billing update was cancelled' - }); + if (status === 'success') { + const popupNotification = createPopupNotification({ + type, status, duration, closeable, autoHide, state: this.state, + message: status === 'success' ? 'Billing info updated successfully' : '' + }); + return { + showPopup: true, + popupNotification + }; + } return { - showPopup: true, - popupNotification + showPopup: true }; } return {}; diff --git a/ghost/portal/src/utils/notifications.js b/ghost/portal/src/utils/notifications.js index b112926b26..875af4ae1a 100644 --- a/ghost/portal/src/utils/notifications.js +++ b/ghost/portal/src/utils/notifications.js @@ -12,7 +12,7 @@ export const handleAuthActions = ({qsParams, action, status}) => { }; export const handleStripeActions = ({status, billingOnly}) => { - if (!billingOnly && ['cancel', 'success'].includes(status)) { + if (!billingOnly && ['success'].includes(status)) { const statusVal = status === 'success' ? 'success' : 'warning'; return { type: 'stripe:checkout',