From ad74b12908a6d4c373d0070fa3c99e1ea0a0c0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20G=C5=82ownia?= Date: Tue, 2 Jan 2024 10:19:10 +0100 Subject: [PATCH] feat(trading): do not show error message if there is no faucet tx error (#5539) --- libs/deposits/src/lib/get-faucet-error.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/deposits/src/lib/get-faucet-error.ts b/libs/deposits/src/lib/get-faucet-error.ts index 61e6f9613..bbb480b19 100644 --- a/libs/deposits/src/lib/get-faucet-error.ts +++ b/libs/deposits/src/lib/get-faucet-error.ts @@ -17,9 +17,12 @@ export const useGetFaucetError = (error: TxError | null, symbol?: string) => { 'The faucet transaction was rejected by the connected Ethereum wallet' ), }; + if (!error) { + return error; + } // render a customized failure message from the map above or fallback // to a non generic error message - return error && 'reason' in error && reasonMap[error.reason] + return 'reason' in error && reasonMap[error.reason] ? reasonMap[error.reason] : t('Faucet of {{symbol}} failed', { symbol: symbol || '' }); };