Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRE-1364] fix edit wallet destination address #618

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading