diff --git a/app/components/client/devprogram-scripts.js b/app/components/client/devprogram-scripts.js index 0dc1f05..c3a4c18 100644 --- a/app/components/client/devprogram-scripts.js +++ b/app/components/client/devprogram-scripts.js @@ -68,22 +68,29 @@ function syncWithApi(data) { // eslint-disable-line no-unused-vars case result.error === "this reward is limited to 1 per person": document.querySelector("developer-program").innerHTML = "

You have already claimed this reward. This reward is limited to ONE per person. Your enthusiasm is appreciated.

"; - break; + return; + + case result.error: + document.querySelector("developer-program").innerHTML = + `

${result.error}

`; + return; case result.success: result = result.data; document.querySelector("developer-program").innerHTML = `

Success! Your wallet has been credited with ${result.reward_amount} LBC.

We have a great reference for the LBRY SDK here to help you get started.

You can see proof of this transaction on our Blockchain Explorer.

`; - break; + return; default: - console.log(data); // eslint-disable-line no-console + console.info(data); // eslint-disable-line no-console document.querySelector("developer-program").innerHTML = - "

The LBRY API might be down. Please try again later.

"; - break; + "

No success or error was received so the LBRY API might be down.
Please try again later.

"; + return; } }) - .catch(() => { + .catch(error => { + console.error(error); + // Idk what the error would be (probably a 500) so let's just have this message document.querySelector("developer-program").innerHTML = "

LBRY API is down. Please try again later.

";