From 5ed6055852b848235f25e511e2a62ff978f511fc Mon Sep 17 00:00:00 2001 From: IvanMahda Date: Thu, 23 May 2024 17:00:10 +0300 Subject: [PATCH] [BRO-29] Better error reporting in the browser wallet in case TokenMetadata Updated CHANGELOG.md Removed optional params --- packages/browser-wallet/CHANGELOG.md | 6 ++++++ .../pages/Account/Tokens/ManageTokens/ManageTokens.tsx | 1 - packages/browser-wallet/src/shared/utils/token-helpers.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index 83b9e1374..e0f38168d 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Added + +- Additional error message. Now instead of not showing invalid tokens, they displayed in token list with corresponding error. In order to show, that we found tokens in contract, but they have error. + ## 1.5.1 ### Fixed diff --git a/packages/browser-wallet/src/popup/pages/Account/Tokens/ManageTokens/ManageTokens.tsx b/packages/browser-wallet/src/popup/pages/Account/Tokens/ManageTokens/ManageTokens.tsx index fe4377ca7..a50c52b8f 100644 --- a/packages/browser-wallet/src/popup/pages/Account/Tokens/ManageTokens/ManageTokens.tsx +++ b/packages/browser-wallet/src/popup/pages/Account/Tokens/ManageTokens/ManageTokens.tsx @@ -69,7 +69,6 @@ export default function AddTokens() { accountTokens.value[contractDetails.index.toString()]?.map((token) => ({ ...token, balance: currentContractBalances[token.id] ?? 0n, - error: '', })) ?? []; setTopTokens(currentChecked); diff --git a/packages/browser-wallet/src/shared/utils/token-helpers.ts b/packages/browser-wallet/src/shared/utils/token-helpers.ts index ab4bc0c43..a7ed453a3 100644 --- a/packages/browser-wallet/src/shared/utils/token-helpers.ts +++ b/packages/browser-wallet/src/shared/utils/token-helpers.ts @@ -349,7 +349,7 @@ export async function getTokens( ); const tokenData: (TokenData | undefined)[] = await Promise.all( ids.map(async (id, index) => { - const internalData: TokenData = { id, metadataLink: '', metadata: {}, balance: 0n, error: '' }; + const internalData: TokenData = { id, metadataLink: '', metadata: {}, balance: 0n }; let metadataUrl; try { metadataUrl = await contract.tokenMetadata(id);