From ef62d435c77814b3f3f302ddf52566cea6696fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Riquelme=20Guzm=C3=A1n?= Date: Wed, 12 Jun 2024 23:14:15 -0400 Subject: [PATCH] fix: small fix to avoid issues when tryng to switch to tangle --- .../transfer/fungible/fungible-token-transfer.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/widget/src/components/transfer/fungible/fungible-token-transfer.ts b/packages/widget/src/components/transfer/fungible/fungible-token-transfer.ts index 15687d67..ecd02ba2 100644 --- a/packages/widget/src/components/transfer/fungible/fungible-token-transfer.ts +++ b/packages/widget/src/components/transfer/fungible/fungible-token-transfer.ts @@ -1,5 +1,5 @@ import type { Domain } from '@buildwithsygma/sygma-sdk-core'; -import { Environment } from '@buildwithsygma/sygma-sdk-core'; +import { Environment, Network } from '@buildwithsygma/sygma-sdk-core'; import type { HTMLTemplateResult } from 'lit'; import { html } from 'lit'; import { customElement, property } from 'lit/decorators.js'; @@ -131,11 +131,12 @@ export class FungibleTokenTransfer extends BaseComponent { if (network) { this.onSourceNetworkSelected?.(network); this.transferController.onSourceNetworkSelected(network); - void this.walletController.switchEvmChain( - network?.chainId, - this.transferController.walletContext.value?.evmWallet - ?.provider as Eip1193Provider - ); + network.type === Network.EVM && + void this.walletController.switchEvmChain( + network?.chainId, + this.transferController.walletContext.value?.evmWallet + ?.provider as Eip1193Provider + ); } }} .networks=${this.transferController.supportedSourceNetworks}