Skip to content

Commit

Permalink
fix(vault): reset step on open dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwoz committed Dec 18, 2024
1 parent 1a037a5 commit 5f5f346
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/Dialogs/WithdrawVaultUSDTDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,20 @@ const DynamicContent = dynamic(() => import('./Content'), {
})

const BaseWithdrawVaultUSDTDialog = () => {
const { show, openDialog, closeDialog } = useDialogSwitch(true)
const { currStep, forward } = useStep<Step>('intro')
const defaultStep = 'intro'
const {
show,
openDialog: baseOpenDialog,
closeDialog,
} = useDialogSwitch(true)
const { currStep, forward, reset } = useStep<Step>(defaultStep)

const openDialog = () => {
if (currStep !== defaultStep) {
reset(defaultStep)
}
baseOpenDialog()
}

useEventListener(OPEN_WITHDRAW_VAULT_USDT_DIALOG, openDialog)

Expand Down

0 comments on commit 5f5f346

Please sign in to comment.