From 66479c199084e43ca8ae1b571d7fa4e1148dc2d3 Mon Sep 17 00:00:00 2001 From: Rish Date: Wed, 10 Jun 2020 18:03:44 +0530 Subject: [PATCH] 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 --- ghost/portal/src/components/pages/SignupPage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ghost/portal/src/components/pages/SignupPage.js b/ghost/portal/src/components/pages/SignupPage.js index 6521f7fdf5..3313cc72e8 100644 --- a/ghost/portal/src/components/pages/SignupPage.js +++ b/ghost/portal/src/components/pages/SignupPage.js @@ -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 ( this.handleSignup(e)} disabled={disabled} brandColor={brandColor}