Skip to content

Commit

Permalink
Fix issue with switching type for action flow
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed May 9, 2024
1 parent 1e64bc0 commit b39b120
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dapp/src/components/TransactionModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect } from "react"
import { StakeFlowProvider, TransactionContextProvider } from "#/contexts"
import { useSidebar } from "#/hooks"
import { useAppDispatch, useSidebar } from "#/hooks"
import { ActionFlowType, BaseModalProps } from "#/types"
import { ModalCloseButton } from "@chakra-ui/react"
import { setType } from "#/store/action-flow"
import { resetState, setType } from "#/store/action-flow"

Check failure on line 6 in dapp/src/components/TransactionModal/index.tsx

View workflow job for this annotation

GitHub Actions / dapp-format

'resetState' is defined but never used. Allowed unused vars must match /^_+$/u
import ModalContentWrapper from "./ModalContentWrapper"
import { ActiveFlowStep } from "./ActiveFlowStep"
import withBaseModal from "../ModalRoot/withBaseModal"
Expand All @@ -14,10 +14,11 @@ type TransactionModalProps = {

function TransactionModalBase({ type }: TransactionModalProps) {
const { onOpen: openSideBar, onClose: closeSidebar } = useSidebar()
const dispatch = useAppDispatch()

useEffect(() => {
setType(type)
}, [type])
dispatch(setType(type))
}, [dispatch, type])

useEffect(() => {
openSideBar()
Expand Down

0 comments on commit b39b120

Please sign in to comment.