Skip to content

Commit

Permalink
Merge pull request #61 from tonkeeper/hotfix/desktop-prices
Browse files Browse the repository at this point in the history
fix: coin page header price corrected
  • Loading branch information
KuznetsovNikita authored Mar 28, 2024
2 parents aec9a99 + 65a457c commit 840e6e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tonkeeper/desktop",
"license": "Apache-2.0",
"version": "3.9.0",
"version": "3.9.1",
"description": "Your desktop wallet on The Open Network",
"main": ".webpack/main",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions packages/uikit/src/desktop-pages/coin/DesktopCoinPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ const CoinInfoAmounts = styled.div`
const CoinInfo: FC<{ token: string }> = ({ token }) => {
const [assets] = useAssets();
const format = useFormatCoinValue();
const { data: tonRate } = useRate(CryptoCurrency.TON);
const { data: rate } = useRate(token);
const { fiat } = useAppContext();

const asset: { symbol: string; image: string; amount: string; fiatAmount: string } | undefined =
useMemo(() => {
if (!assets || !tonRate) {
if (!assets || !rate) {
return undefined;
}

Expand All @@ -165,7 +165,7 @@ const CoinInfo: FC<{ token: string }> = ({ token }) => {
amount: format(amount),
fiatAmount: formatFiatCurrency(
fiat,
new BigNumber(tonRate.prices).multipliedBy(shiftedDecimals(amount))
new BigNumber(rate.prices).multipliedBy(shiftedDecimals(amount))
)
};
}
Expand All @@ -186,12 +186,12 @@ const CoinInfo: FC<{ token: string }> = ({ token }) => {
amount: format(amount, jettonBalance.jetton.decimals),
fiatAmount: formatFiatCurrency(
fiat,
new BigNumber(tonRate.prices).multipliedBy(
new BigNumber(rate.prices || 0).multipliedBy(
shiftedDecimals(jettonBalance.balance, jettonBalance.jetton.decimals)
)
)
};
}, [assets, format, tonRate, fiat]);
}, [assets, format, rate, fiat]);

if (!asset) {
return <></>;
Expand Down

0 comments on commit 840e6e6

Please sign in to comment.