From aab1560d7f0aeb33d248f2d6ed5c1b400ea1fbea Mon Sep 17 00:00:00 2001 From: soham2k06 Date: Mon, 15 Jan 2024 14:08:47 +0530 Subject: [PATCH] redo --- components/editor.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/editor.tsx b/components/editor.tsx index 445f25f..21f2bb6 100644 --- a/components/editor.tsx +++ b/components/editor.tsx @@ -24,7 +24,7 @@ interface EditorProps { type FormData = z.infer export function Editor({ post }: EditorProps) { - const { register, handleSubmit, formState } = useForm({ + const { register, handleSubmit } = useForm({ resolver: zodResolver(postPatchSchema), }) const ref = React.useRef() @@ -84,8 +84,6 @@ export function Editor({ post }: EditorProps) { }, [isMounted, initializeEditor]) async function onSubmit(data: FormData) { - if (!formState.isDirty) return - setIsSaving(true) const blocks = await ref.current?.save() @@ -142,7 +140,7 @@ export function Editor({ post }: EditorProps) {