Skip to content

Commit

Permalink
fix: withdraw list default selector
Browse files Browse the repository at this point in the history
  • Loading branch information
jinming0618 committed Jan 2, 2025
1 parent b3a3352 commit 060cc5b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/ui/views/GasAccount/components/WithdrawPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ const Selector = ({
? selectAddressChainList?.recharge_chain_list?.sort(
(a, b) => b.withdraw_limit - a.withdraw_limit
) || []
: withdrawList?.sort(
(a, b) => b.total_withdraw_limit - a.total_withdraw_limit
) || [],
: withdrawList,
[selectAddressChainList, withdrawList, isSelectChain]
);

Expand Down Expand Up @@ -363,13 +361,15 @@ const WithdrawContent = ({
id: accountId!,
});
if (res) {
const data = res?.filter((item) => {
const { recharge_addr } = item;
const idx = accountsList.findIndex(
(i) => i.address === recharge_addr
);
return idx > -1;
});
const data = res
?.filter((item) => {
const { recharge_addr } = item;
const idx = accountsList.findIndex(
(i) => i.address === recharge_addr
);
return idx > -1;
})
.sort((a, b) => b.total_withdraw_limit - a.total_withdraw_limit);

setWithdrawList(data);
setSelectAddressChainList(data[0]);
Expand Down

0 comments on commit 060cc5b

Please sign in to comment.