Skip to content

Commit

Permalink
fix: update wallet filtering logic and clean up unused variables in S…
Browse files Browse the repository at this point in the history
…wapExecutionPage
  • Loading branch information
ericHgorski committed Dec 26, 2024
1 parent 0a70f47 commit ac9eed7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/widget/src/components/RenderWalletList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const RenderWalletList = ({

const displayWallets = useMemo(() => {
const filteredWallets = walletList.filter(
(wallet) => isMinimalWallet(wallet) && wallet?.isAvailable !== false
(wallet) => isManualWalletEntry(wallet) || wallet?.isAvailable !== false
);

return filteredWallets.length === 1 ? walletList : filteredWallets;
Expand Down Expand Up @@ -124,15 +124,15 @@ export const RenderWalletList = ({

const renderedRightContent = rightContent?.() ?? <></>;

const imageElement = (
const imageElement = imageUrl ? (
<img
height={35}
width={35}
style={{ objectFit: "cover" }}
src={imageUrl}
alt={`${name}-logo`}
/>
)
) : null;

const onClickConnectWallet = () => {
if (isMinimalWallet(wallet)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,14 @@ export const SwapExecutionPage = () => {
}, [signaturesRemaining, shouldDisplaySignaturesRemaining]);

const onClickEditDestinationWallet = useMemo(() => {
const lastIndex = chainAddresses ? Object.keys(chainAddresses).length - 1 : 0;
const destinationAddress = chainAddresses?.[lastIndex]?.address;
const loadingStates = [
SwapExecutionState.pending,
SwapExecutionState.waitingForSigning,
SwapExecutionState.validatingGasBalance,
SwapExecutionState.confirmed
];

if (loadingStates.includes(swapExecutionState) || !destinationAddress) {
if (loadingStates.includes(swapExecutionState)) {
return undefined;
}

Expand All @@ -116,7 +114,7 @@ export const SwapExecutionPage = () => {
chainId: route?.destAssetChainID,
});
};
}, [chainAddresses, swapExecutionState, route?.destAssetChainID]);
}, [swapExecutionState, route?.destAssetChainID]);



Expand Down

0 comments on commit ac9eed7

Please sign in to comment.