From b2b4de11f6ce31900fbb4fe764e51890b3ba8e57 Mon Sep 17 00:00:00 2001 From: Yaroslav Grachev Date: Wed, 25 Dec 2024 13:09:38 +0300 Subject: [PATCH] fix: use dynamic pallet (#2897) --- .../assets/AssetsPortfolioView/ui/AssembledAssetAmount.tsx | 5 +++-- src/renderer/shared/api/balances/service/balanceService.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/features/assets/AssetsPortfolioView/ui/AssembledAssetAmount.tsx b/src/renderer/features/assets/AssetsPortfolioView/ui/AssembledAssetAmount.tsx index 9c206b514..1b4868df8 100644 --- a/src/renderer/features/assets/AssetsPortfolioView/ui/AssembledAssetAmount.tsx +++ b/src/renderer/features/assets/AssetsPortfolioView/ui/AssembledAssetAmount.tsx @@ -16,13 +16,14 @@ type Props = PropsWithChildren & { export const AssembledAssetAmount = ({ balance, asset }: Props) => { const { t } = useI18n(); + const fiatFlag = useUnit(priceProviderModel.$fiatFlag); if (!balance?.free) { return (
- - {fiatFlag && } + + {fiatFlag && }
); } diff --git a/src/renderer/shared/api/balances/service/balanceService.ts b/src/renderer/shared/api/balances/service/balanceService.ts index 49786c345..d8fa934b2 100644 --- a/src/renderer/shared/api/balances/service/balanceService.ts +++ b/src/renderer/shared/api/balances/service/balanceService.ts @@ -157,7 +157,7 @@ function subscribeStatemineAssetsChange( throw new Error(`Pallet ${pallet} not found.`); } - const type = api.tx.foreignAssets.transfer.meta.args[0].type; + const type = api.tx[pallet]?.transfer.meta.args[0].type; if (nullable(type)) { return Promise.resolve(noop); }