From 7f6de07b1efa768c15861de07b793d14767f433e Mon Sep 17 00:00:00 2001 From: Sag Date: Thu, 3 Aug 2023 23:00:42 +0200 Subject: [PATCH] Removed unconsistent success state from the donation page (#17590) refs https://github.com/TryGhost/Product/issues/3650 --- apps/portal/src/components/pages/SupportPage.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/portal/src/components/pages/SupportPage.js b/apps/portal/src/components/pages/SupportPage.js index 40c62e8e69..5c09c67b96 100644 --- a/apps/portal/src/components/pages/SupportPage.js +++ b/apps/portal/src/components/pages/SupportPage.js @@ -1,6 +1,5 @@ import {useEffect, useState, useContext} from 'react'; import SupportError from './SupportError'; -import SupportSuccess from './SupportSuccess'; import LoadingPage from './LoadingPage'; import setupGhostApi from '../../utils/api'; import AppContext from '../../AppContext'; @@ -22,13 +21,12 @@ const SupportPage = () => { const response = await api.member.checkoutDonation({successUrl, cancelUrl}); if (response.url) { - await window.location.assign(response.url); + window.location.assign(response.url); } } catch (err) { const errorMessage = err.message || 'There was an error processing your payment. Please try again.'; - setError(errorMessage); - } finally { setLoading(false); + setError(errorMessage); } } @@ -52,7 +50,7 @@ const SupportPage = () => { return ; } - return ; + return null; }; export default SupportPage;