mirror of
https://github.com/reconurge/flowsint.git
synced 2026-07-18 19:20:13 -05:00
feat(app): close new sketch modal while on already existing sketch page
This commit is contained in:
@@ -30,7 +30,7 @@ interface NewSketchProps {
|
||||
export default function NewSketch({ children }: NewSketchProps) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const router = useRouter()
|
||||
const { investigationId } = useParams({ strict: false })
|
||||
const { investigationId, id: sketchId } = useParams({ strict: false })
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const {
|
||||
@@ -59,6 +59,7 @@ export default function NewSketch({ children }: NewSketchProps) {
|
||||
queryKey: queryKeys.investigations.sketches(investigationId)
|
||||
})
|
||||
}
|
||||
if (sketchId) setOpen(false)
|
||||
} else {
|
||||
toast.error(result.error || 'Failed to create sketch.')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user