From 2f3f38c578a294e7d7b08254dbca7980ec9852fb Mon Sep 17 00:00:00 2001 From: evavirseda Date: Tue, 7 May 2024 17:59:13 +0200 Subject: [PATCH] fix available balance toggle on custom network (#8503) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Begoña Álvarez de la Cruz Co-authored-by: cpl121 <100352899+cpl121@users.noreply.github.com> --- .../labels/TogglableAssetBalanceLabel.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/shared/components/labels/TogglableAssetBalanceLabel.svelte b/packages/shared/components/labels/TogglableAssetBalanceLabel.svelte index 831aa4f7fb5..d754a2da49b 100644 --- a/packages/shared/components/labels/TogglableAssetBalanceLabel.svelte +++ b/packages/shared/components/labels/TogglableAssetBalanceLabel.svelte @@ -3,12 +3,15 @@ import { formatTokenAmountBestMatch, IAsset } from '@core/wallet' import { formatCurrency, localize } from '@core/i18n' import { getMarketAmountFromAssetValue } from '@core/market/utils' + import { NetworkId } from '@core/network' + import { activeProfile } from '@core/profile' export let asset: IAsset $: availableMarketValue = getMarketAmountFromAssetValue(asset?.balance?.available, asset) $: totalMarketValue = getMarketAmountFromAssetValue(asset?.balance?.total, asset) $: disabled = Number.isNaN(totalMarketValue) || Number.isNaN(availableMarketValue) + $: isCustomNetwork = $activeProfile?.network?.id === NetworkId.Custom let isToggled = false function toggle(): void { @@ -20,16 +23,17 @@