Skip to content

Commit

Permalink
fix: network form should not display error if chain is unreachable (#620
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jurevans authored Feb 6, 2024
1 parent bda16c1 commit 76c497a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/extension/src/background/chains/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ export class ChainsService {
} = defaultChain;
if (!address) {
const query = new Query(defaultChain.rpc);
const nativeToken = await query.query_native_token();
defaultChain.currency.address = nativeToken || tokenAddress;
try {
const nativeToken = await query.query_native_token();
defaultChain.currency.address = nativeToken || tokenAddress;
} catch (e) {
console.warn(`Chain is not reachable: ${e}`);
}
}

await this.chainsStore.set(CHAINS_KEY, defaultChain);
Expand Down

3 comments on commit 76c497a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.