From 498a2d09fff26ff8b1adf356dd8307f0d0df01b5 Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Mon, 25 Nov 2024 10:38:50 +0100 Subject: [PATCH] fix: modify withdraw page select button dispatch logic --- src/app/components/vault/vault.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/components/vault/vault.tsx b/src/app/components/vault/vault.tsx index 142e457b..8aaa7cc2 100644 --- a/src/app/components/vault/vault.tsx +++ b/src/app/components/vault/vault.tsx @@ -5,6 +5,7 @@ import { VStack } from '@chakra-ui/react'; import { Vault as VaultModel } from '@models/vault'; import { BitcoinTransactionConfirmationsContext } from '@providers/bitcoin-query-provider'; import { mintUnmintActions } from '@store/slices/mintunmint/mintunmint.actions'; +import { RedeemSteps } from '@store/slices/mintunmint/mintunmint.slice'; import { VaultDetails } from './components/vault.detaills/vault.details'; import { VaultHeader } from './components/vault.header/vault.header'; @@ -24,8 +25,9 @@ export function Vault({ vault, variant, handleClose }: VaultProps): React.JSX.El function handleMainButtonClick() { if (variant === 'select') { - const step = vault.valueLocked === vault.valueMinted ? 0 : 1; - dispatch(mintUnmintActions.setUnmintStep([step, vault.uuid, vault])); + const step = + vault.valueLocked === vault.valueMinted ? RedeemSteps.BURN : RedeemSteps.WITHDRAW; + dispatch(mintUnmintActions.setUnmintStep({ step, vault })); } else { setIsVaultExpanded(!isVaultExpanded); } @@ -59,7 +61,6 @@ export function Vault({ vault, variant, handleClose }: VaultProps): React.JSX.El handleClose={handleClose} /> -