diff --git a/constants/error-message.ts b/constants/error-message.ts index b50f388..aacdbf4 100644 --- a/constants/error-message.ts +++ b/constants/error-message.ts @@ -23,3 +23,11 @@ export const VERIFICATION_THRESHOLD_MESSAGE = export const INVALID_REFERRAL_ERROR = "Invalid referral:"; export const INVALID_REFERRAL_MESSAGE = "Make sure that the referrer ICNS name has been registered."; + +export const TOO_MANY_CHAINS_IN_LEDGER_ERROR = "Output buffer too small"; +export const TOO_MANY_CHAINS_IN_LEDGER_MESSAGE = + "Maximum 20 chains can be linked at a time on Ledger hardware wallet. Unselect some chains and try again."; + +export const EVM_CHAIN_IN_LEDGER_ERROR = "Ledger is unsupported for this chain"; +export const EVM_CHAIN_IN_LEDGER_MESSAGE = + "Ledger is unsupported for this chain. Remove EVM-based Cosmos SDK chains and try again."; diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index e2c8970..8814a58 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -54,11 +54,15 @@ import { import { ACCOUNT_NOT_EXIST_ERROR, ACCOUNT_NOT_EXIST_MESSAGE, + EVM_CHAIN_IN_LEDGER_ERROR, + EVM_CHAIN_IN_LEDGER_MESSAGE, INSUFFICIENT_GAS_ERROR, INSUFFICIENT_GAS_MESSAGE, INVALID_REFERRAL_ERROR, INVALID_REFERRAL_MESSAGE, KEPLR_NOT_FOUND_ERROR, + TOO_MANY_CHAINS_IN_LEDGER_ERROR, + TOO_MANY_CHAINS_IN_LEDGER_MESSAGE, TWITTER_LOGIN_ERROR, VERIFICATION_THRESHOLD_ERROR, VERIFICATION_THRESHOLD_MESSAGE, @@ -498,6 +502,18 @@ export default function VerificationPage() { console.log(errorMessage); captureException(errorMessage); + if (error.message.includes(TOO_MANY_CHAINS_IN_LEDGER_ERROR)) { + setErrorMessage({ message: TOO_MANY_CHAINS_IN_LEDGER_MESSAGE }); + setErrorModalOpen(true); + return; + } + + if (error.message.includes(EVM_CHAIN_IN_LEDGER_ERROR)) { + setErrorMessage({ message: EVM_CHAIN_IN_LEDGER_MESSAGE }); + setErrorModalOpen(true); + return; + } + setErrorMessage({ message: error.message }); setErrorModalOpen(true); }