Skip to content

Commit 352b1fc

Browse files
committed
Fix decimals in Widget amount
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
1 parent 315cbf5 commit 352b1fc

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
@@ -46,7 +46,6 @@ const TxHistoryItem = (props: Props) => {
4646
txHash,
4747
amount,
4848
amountUsd,
49-
recipient,
5049
fromChain,
5150
fromToken,
5251
toChain,
@@ -63,8 +62,7 @@ const TxHistoryItem = (props: Props) => {
6362
),
6463
[],
6564
);
66-
const { getTokenPrice, isFetchingTokenPrices, lastTokenPriceUpdate } =
67-
useTokens();
65+
const { getTokenPrice, lastTokenPriceUpdate } = useTokens();
6866

6967
// Render details for the sent amount
7068
const sentAmount = useMemo(() => {
@@ -132,15 +130,17 @@ const TxHistoryItem = (props: Props) => {
132130
</Stack>
133131
</Stack>
134132
);
133+
// ESLint complains that lastTokenPriceUpdate is unused/unnecessary here,
134+
// but we want to recompute the price after we update conversion rates.
135+
// eslint-disable-next-line react-hooks/exhaustive-deps
135136
}, [
136-
isFetchingTokenPrices,
137137
lastTokenPriceUpdate,
138-
receiveAmount,
138+
toChain,
139139
toToken,
140-
recipient,
140+
receiveAmount,
141+
getTokenPrice,
141142
separator,
142143
theme.palette.text.secondary,
143-
toChain,
144144
]);
145145

146146
// 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
@@ -290,7 +290,7 @@ const WidgetItem = (props: Props) => {
290290
</Typography>
291291
<Stack direction="row" alignItems="center">
292292
<Typography fontSize={14} marginRight="8px">
293-
{`${sdkAmount.display(sdkAmount.truncate(amount, 4))} ${
293+
{`${sdkAmount.display(sdkAmount.truncate(amount, 6))} ${
294294
token.symbol
295295
}`}
296296
</Typography>

0 commit comments

Comments
 (0)