Skip to content

Commit

Permalink
clean state before opening rather then before closing
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Aug 26, 2022
1 parent 8022e5f commit 1778246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions catalog/app/components/Dialog/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ interface PromptProps {
export function usePrompt({ initialValue, title, onSubmit, validate }: PromptProps) {
const [key, setKey] = React.useState(0)
const [opened, setOpened] = React.useState(false)
const open = React.useCallback(() => setOpened(true), [])
const close = React.useCallback(() => {
setOpened(false)
const open = React.useCallback(() => {
setKey(R.inc)
setOpened(true)
}, [])
const close = React.useCallback(() => setOpened(false), [])
const handleSubmit = React.useCallback(
(value: string) => {
onSubmit(value)
Expand Down

0 comments on commit 1778246

Please sign in to comment.