Skip to content

Commit

Permalink
refactor: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
gin-lsl committed Mar 5, 2025
1 parent 07d2035 commit 21ea1f6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/tron/src/provider/config-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ export const AntDesignWeb3ConfigProvider: React.FC<
}
}, [address]);

const walletsList = useMemo(
() => [
...wallets.filter((a: any) => a.state !== AdapterState.NotFound),
...wallets.filter((a: any) => a.state === AdapterState.NotFound),
],
[wallets],
);
// const walletsList = useMemo(
// () => [
// ...wallets.filter((a) => a.state !== AdapterState.NotFound),
// ...wallets.filter((a) => a.state === AdapterState.NotFound),
// ],
// [wallets],
// );

const allWallets = useMemo<Wallet[]>(() => {
const providedWallets = availableWallets?.map<Wallet>((w) => {
const adapter = walletsList?.find((item) => item.adapter.name === w.name)?.adapter;
const adapter = wallets?.find((item) => item.adapter.name === w.name)?.adapter;

return {
...w,
Expand All @@ -67,7 +67,7 @@ export const AntDesignWeb3ConfigProvider: React.FC<
};
});
return providedWallets || [];
}, [availableWallets, walletsList]);
}, [availableWallets, wallets]);

useEffect(() => {
if (connectionError) {
Expand Down

0 comments on commit 21ea1f6

Please sign in to comment.