0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Added error handling for checkout/signup failure

closes https://github.com/TryGhost/members.js/issues/38

- Added error state to signup action button in case of action failure like checkout session rejection
- Checkout session rejection was previously incorrectly timing out and returning 200
This commit is contained in:
Rish 2020-06-10 18:03:44 +05:30
parent e538f9b363
commit 66479c1990

View file

@ -35,10 +35,16 @@ class SignupPage extends React.Component {
renderSubmitButton() {
const {action, brandColor} = this.context;
const label = (action === 'signup:running') ? 'Sending...' : 'Continue';
let label = (action === 'signup:running') ? 'Sending...' : 'Continue';
let retry = false;
if (action === 'signup:failed') {
label = 'Retry';
retry = true;
}
const disabled = (action === 'signup:running') ? true : false;
return (
<ActionButton
retry={retry}
onClick={e => this.handleSignup(e)}
disabled={disabled}
brandColor={brandColor}