Skip to content

Commit 1a7e5d6

Browse files
authored
fix: swap web toaccount fix (#8997)
1 parent 6f287ed commit 1a7e5d6

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

packages/kit/src/views/Swap/hooks/useSwapAccount.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -301,34 +301,19 @@ export function useSwapAddressInfo(type: ESwapDirectionType) {
301301
swapToAnotherAccountAddressAtom.accountInfo.account &&
302302
activeAccount &&
303303
activeAccount.account &&
304-
activeAccount.network?.id === swapToAnotherAccountAddressAtom.networkId
304+
(activeAccount.network?.id ===
305+
swapToAnotherAccountAddressAtom.networkId ||
306+
isAllNetwork)
305307
) {
306308
return {
307309
...res,
308-
address: isAllNetwork
309-
? accountForAllNet?.addressDetail?.address
310-
: swapToAnotherAccountAddressAtom.address,
311-
networkId:
312-
isAllNetwork && tokenNetworkId
313-
? tokenNetworkId
314-
: swapToAnotherAccountAddressAtom.networkId,
310+
address: swapToAnotherAccountAddressAtom.address ?? '',
311+
networkId: swapToAnotherAccountAddressAtom.networkId ?? '',
315312
accountInfo: {
316313
...swapToAnotherAccountAddressAtom.accountInfo,
317-
account: {
318-
...swapToAnotherAccountAddressAtom.accountInfo.account,
319-
id: isAllNetwork
320-
? accountForAllNet?.id ?? ''
321-
: swapToAnotherAccountAddressAtom.accountInfo?.account?.id ?? '',
322-
},
323314
},
324315
activeAccount: {
325316
...activeAccount,
326-
account: {
327-
...activeAccount.account,
328-
id: isAllNetwork
329-
? accountForAllNet?.id ?? ''
330-
: activeAccount.account?.id ?? '',
331-
},
332317
},
333318
};
334319
}

0 commit comments

Comments
 (0)