Skip to content

Commit 78de537

Browse files
authored
Fix decimals in Widget amount (#3303)
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
1 parent 60b0247 commit 78de537

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

wormhole-connect/src/views/v2/TxHistory/Item/index.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const TxHistoryItem = (props: Props) => {
4747
txHash,
4848
amount,
4949
amountUsd,
50-
recipient,
5150
fromChain,
5251
fromToken,
5352
toChain,
@@ -64,8 +63,7 @@ const TxHistoryItem = (props: Props) => {
6463
),
6564
[],
6665
);
67-
const { getTokenPrice, isFetchingTokenPrices, lastTokenPriceUpdate } =
68-
useTokens();
66+
const { getTokenPrice, lastTokenPriceUpdate } = useTokens();
6967

7068
// Render details for the sent amount
7169
const sentAmount = useMemo(() => {
@@ -133,15 +131,17 @@ const TxHistoryItem = (props: Props) => {
133131
</Stack>
134132
</Stack>
135133
);
134+
// ESLint complains that lastTokenPriceUpdate is unused/unnecessary here,
135+
// but we want to recompute the price after we update conversion rates.
136+
// eslint-disable-next-line react-hooks/exhaustive-deps
136137
}, [
137-
isFetchingTokenPrices,
138138
lastTokenPriceUpdate,
139-
receiveAmount,
139+
toChain,
140140
toToken,
141-
recipient,
141+
receiveAmount,
142+
getTokenPrice,
142143
separator,
143144
theme.palette.text.secondary,
144-
toChain,
145145
]);
146146

147147
// Vertical line that connects sender and receiver token icons

wormhole-connect/src/views/v2/TxHistory/Widget/Item.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const WidgetItem = (props: Props) => {
289289
</Typography>
290290
<Stack direction="row" alignItems="center">
291291
<Typography fontSize={14} marginRight="8px">
292-
{`${sdkAmount.display(sdkAmount.truncate(amount, 4))} ${
292+
{`${sdkAmount.display(sdkAmount.truncate(amount, 6))} ${
293293
token.symbol
294294
}`}
295295
</Typography>

0 commit comments

Comments
 (0)