Skip to content

Commit

Permalink
[BRO-29] Better error reporting in the browser wallet in case TokenMe…
Browse files Browse the repository at this point in the history
…tadata

Updated CHANGELOG.md
Removed optional params
  • Loading branch information
Ivan-Mahda committed May 23, 2024
1 parent a108e60 commit 5ed6055
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/browser-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default function AddTokens() {
accountTokens.value[contractDetails.index.toString()]?.map((token) => ({
...token,
balance: currentContractBalances[token.id] ?? 0n,
error: '',
})) ?? [];

setTopTokens(currentChecked);
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/src/shared/utils/token-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ed6055

Please sign in to comment.