From c3dbfd0d0e6e00344cbc63a985f37759a622cf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=B1=B1=E6=A0=8B?= Date: Wed, 9 Oct 2024 17:47:49 +0800 Subject: [PATCH] fix: swap toToken fromToken network same address create only one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王山栋 --- .../kit/src/states/jotai/contexts/swap/actions.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/kit/src/states/jotai/contexts/swap/actions.ts b/packages/kit/src/states/jotai/contexts/swap/actions.ts index 1aa07977062..88d5fd8e897 100644 --- a/packages/kit/src/states/jotai/contexts/swap/actions.ts +++ b/packages/kit/src/states/jotai/contexts/swap/actions.ts @@ -870,12 +870,14 @@ class ContentJotaiActionsSwap extends ContextJotaiActionsBase { walletId: swapToAddressInfo.accountInfo?.wallet?.id, })) ) { - const alertAction = this.checkAddressNeedCreate( - swapSupportAllNetworks, - toToken, - swapToAddressInfo, - ); - alertsRes = [...alertsRes, alertAction]; + if (!(fromToken && fromToken.networkId === toToken.networkId)) { + const alertAction = this.checkAddressNeedCreate( + swapSupportAllNetworks, + toToken, + swapToAddressInfo, + ); + alertsRes = [...alertsRes, alertAction]; + } } if (quoteResult?.toAmount && !quoteResult.isBest) {