From 48bd9985d2d61a61f37659760885c035c296d970 Mon Sep 17 00:00:00 2001 From: duongynhi000005-oss Date: Tue, 26 May 2026 03:41:24 +0000 Subject: [PATCH] Fix Stake CAP approve loading state --- src/components/modals/StakeCAP.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/modals/StakeCAP.svelte b/src/components/modals/StakeCAP.svelte index 2e4bf18..3a5eeb7 100644 --- a/src/components/modals/StakeCAP.svelte +++ b/src/components/modals/StakeCAP.svelte @@ -13,7 +13,7 @@ import { focusInput, hideModal } from '@lib/ui' import LabelValue from '../layout/LabelValue.svelte' - let amount, isSubmitting, walletBalance = "0.0"; + let amount, isSubmitting, isApproving, walletBalance = "0.0"; $: formattedWalletBalance = formatCAPForDisplay(walletBalance); @@ -35,7 +35,12 @@ } async function _approveAsset() { - const result = await approveAsset('CAP', 'FundStore'); + isApproving = true; + try { + await approveAsset('CAP', 'FundStore'); + } finally { + isApproving = false; + } } async function getBalance() { @@ -75,7 +80,7 @@
{#if $allowances['CAP']?.['FundStore'] * 1 <= amount * 1} -