Skip to content

Commit

Permalink
Fix decimals in Widget amount
Browse files Browse the repository at this point in the history
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
  • Loading branch information
emreboga committed Feb 26, 2025
1 parent 60b0247 commit 3981b24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions wormhole-connect/src/views/v2/TxHistory/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const TxHistoryItem = (props: Props) => {
txHash,
amount,
amountUsd,
recipient,
fromChain,
fromToken,
toChain,
Expand All @@ -64,8 +63,7 @@ const TxHistoryItem = (props: Props) => {
),
[],
);
const { getTokenPrice, isFetchingTokenPrices, lastTokenPriceUpdate } =
useTokens();
const { getTokenPrice, lastTokenPriceUpdate } = useTokens();

// Render details for the sent amount
const sentAmount = useMemo(() => {
Expand Down Expand Up @@ -133,15 +131,17 @@ const TxHistoryItem = (props: Props) => {
</Stack>
</Stack>
);
// ESLint complains that lastTokenPriceUpdate is unused/unnecessary here,
// but we want to recompute the price after we update conversion rates.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
isFetchingTokenPrices,
lastTokenPriceUpdate,
receiveAmount,
toChain,
toToken,
recipient,
receiveAmount,
getTokenPrice,
separator,
theme.palette.text.secondary,
toChain,
]);

// Vertical line that connects sender and receiver token icons
Expand Down
2 changes: 1 addition & 1 deletion wormhole-connect/src/views/v2/TxHistory/Widget/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const WidgetItem = (props: Props) => {
</Typography>
<Stack direction="row" alignItems="center">
<Typography fontSize={14} marginRight="8px">
{`${sdkAmount.display(sdkAmount.truncate(amount, 4))} ${
{`${sdkAmount.display(sdkAmount.truncate(amount, 6))} ${
token.symbol
}`}
</Typography>
Expand Down

0 comments on commit 3981b24

Please sign in to comment.