Skip to content

Commit

Permalink
[FRE-1364] fix edit wallet destination address (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericHgorski authored Dec 26, 2024
1 parent 60add51 commit c7d3743
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-seals-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skip-go/widget': patch
---

fix edit desintation address
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,15 @@ 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
SwapExecutionState.confirmed,
SwapExecutionState.signaturesRemaining,
];

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

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



Expand Down

0 comments on commit c7d3743

Please sign in to comment.