We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8c03bd7 + a934eca commit 653f1e1Copy full SHA for 653f1e1
src/ui/views/Swap/hooks/token.tsx
@@ -643,10 +643,25 @@ export const useTokenPair = (userAddress: string) => {
643
});
644
if (target) {
645
setChain(target?.enum);
646
- setPayToken({
647
- ...getChainDefaultToken(target?.enum),
648
- id: searchObj.payTokenId,
649
- });
+ wallet.openapi
+ .getToken(userAddress, target.serverId, searchObj.payTokenId)
+ .then(
+ (token) => {
650
+ if (active) {
651
+ if (token) {
652
+ setPayToken(token);
653
+ } else {
654
+ switchChain(target.enum);
655
+ }
656
657
+ },
658
+ () => {
659
660
661
662
663
+ );
664
+
665
if (searchObj?.inputAmount && !searchObj?.isMax) {
666
handleAmountChange(searchObj?.inputAmount);
667
}
0 commit comments