Removed unconsistent success state from the donation page (#17590)

refs https://github.com/TryGhost/Product/issues/3650
This commit is contained in:
Sag 2023-08-03 23:00:42 +02:00 committed by GitHub
parent 7e9b2d4883
commit 7f6de07b1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 <SupportError error={error} />;
}
return <SupportSuccess />;
return null;
};
export default SupportPage;