diff --git a/boba_community/turing-captcha-faucet/packages/gate/src/containers/Faucet/Faucet.js b/boba_community/turing-captcha-faucet/packages/gate/src/containers/Faucet/Faucet.js index d126a79bc2..74addc7fea 100644 --- a/boba_community/turing-captcha-faucet/packages/gate/src/containers/Faucet/Faucet.js +++ b/boba_community/turing-captcha-faucet/packages/gate/src/containers/Faucet/Faucet.js @@ -39,19 +39,26 @@ function Faucet() { setLoading(true); const res = await networkService.verifyCAPTCHAImage(value, captchaInfo.uuid, key); if (res.error) { - let error = res?.error?.data?.message; + let error = res?.error?.data?.message + console.log("error:", error) if (error === "execution reverted: Invalid request") { - error = "You reached the request limit. Please come back again after 24 hours!"; + error = "You reached the request limit. Please come back again after 24 hours!" + dispatch(openAlert(error)) + } else if (error === "execution reverted: Invalid key and UUID"){ + error = "You failed the CAPTCHA test. Are you human? Please try again" + dispatch(openError(error)) + } else if (error === "execution reverted: TURING: Server error"){ + error = "Servers are starting from cold boot. Please try again in 15 seconds" + dispatch(openAlert(error)) } - dispatch(openError(error)); - dispatch(getCAPTCHAImage()); - setKey(""); + dispatch(getCAPTCHAImage()) + setKey("") } else { - dispatch(openAlert(`${value === 1 ? "10 test BOBA" : "0.1 test ETH"} was sent to your wallet`)); - dispatch(getCAPTCHAImage()); - setKey(""); + dispatch(openAlert(`${value === 1 ? "10 test BOBA" : "0.1 test ETH"} was sent to your wallet`)) + dispatch(getCAPTCHAImage()) + setKey("") } - setLoading(false); + setLoading(false) }; const hasFunds = account ? accountBalance > 500000000000000 : false; @@ -67,8 +74,7 @@ function Faucet() {