Skip to content

Commit 653f1e1

Browse files
committed
Merge branch 'feat/tab-send' into tmp/20250117
2 parents 8c03bd7 + a934eca commit 653f1e1

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/ui/views/Swap/hooks/token.tsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,25 @@ export const useTokenPair = (userAddress: string) => {
643643
});
644644
if (target) {
645645
setChain(target?.enum);
646-
setPayToken({
647-
...getChainDefaultToken(target?.enum),
648-
id: searchObj.payTokenId,
649-
});
646+
wallet.openapi
647+
.getToken(userAddress, target.serverId, searchObj.payTokenId)
648+
.then(
649+
(token) => {
650+
if (active) {
651+
if (token) {
652+
setPayToken(token);
653+
} else {
654+
switchChain(target.enum);
655+
}
656+
}
657+
},
658+
() => {
659+
if (active) {
660+
switchChain(target.enum);
661+
}
662+
}
663+
);
664+
650665
if (searchObj?.inputAmount && !searchObj?.isMax) {
651666
handleAmountChange(searchObj?.inputAmount);
652667
}

0 commit comments

Comments
 (0)