mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
Removed unconsistent success state from the donation page (#17590)
refs https://github.com/TryGhost/Product/issues/3650
This commit is contained in:
parent
7e9b2d4883
commit
7f6de07b1e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user