Skip to content

Commit

Permalink
fix: ens name in AccountLabel, check amount on update
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Sep 29, 2023
1 parent 241e6fe commit 41bccf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions libs/oeth/swap/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export const useHandleAmountInChange = () => {
(amount: bigint) => {
setSwapState(
produce((state) => {
state.amountIn = amount;
state.isSwapRoutesLoading = amount !== 0n;
if (state.amountIn !== amount) {
state.amountIn = amount;
state.isSwapRoutesLoading = amount !== 0n;
}
}),
);
},
Expand Down
12 changes: 6 additions & 6 deletions libs/shared/providers/src/wagmi/components/AddressLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export const AddressLabel = ({
chainId: mainnet.id,
});

if (short) {
return (
<MiddleTruncated {...rest}>{middleTruncate(address)}</MiddleTruncated>
);
}

if (enableEnsName) {
return isEnsNameLoading ? (
<Skeleton sx={{ minWidth: 100, ...rest?.sx }} />
Expand All @@ -42,5 +36,11 @@ export const AddressLabel = ({
);
}

if (short) {
return (
<MiddleTruncated {...rest}>{middleTruncate(address)}</MiddleTruncated>
);
}

return <MiddleTruncated textProps={{ ...rest }}>{address}</MiddleTruncated>;
};

0 comments on commit 41bccf3

Please sign in to comment.