Skip to content

Commit

Permalink
fix: swap toToken fromToken network same address create only one
Browse files Browse the repository at this point in the history
Signed-off-by: 王山栋 <[email protected]>
  • Loading branch information
ezailWang committed Oct 9, 2024
1 parent dbf0f11 commit c3dbfd0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/kit/src/states/jotai/contexts/swap/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c3dbfd0

Please sign in to comment.