From 46c47b59775ceb06faae469f50928696dc7f40ad Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 13 Sep 2025 22:27:38 -0700 Subject: [PATCH] fix: comment forms submitting via POST instead of PUT --- .gitignore | 3 ++- src/lib/components/lemmy/comment/CommentForm.svelte | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 212b8c14..e8a47f60 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ yarn-error.log yarn.lock playwright-report -test-results \ No newline at end of file +test-results +.vscode \ No newline at end of file diff --git a/src/lib/components/lemmy/comment/CommentForm.svelte b/src/lib/components/lemmy/comment/CommentForm.svelte index 514b19e3..ce39199d 100644 --- a/src/lib/components/lemmy/comment/CommentForm.svelte +++ b/src/lib/components/lemmy/comment/CommentForm.svelte @@ -26,6 +26,7 @@ required?: boolean id?: string label?: string + editing?: boolean oncomment?: (comment: CommentResponse) => void onconfirm?: (value: string) => void oncancel?: (cancel: boolean) => void @@ -41,6 +42,7 @@ value = $bindable(''), actions = true, preview: previewAction = true, + editing = false, oncancel, oncomment, ...rest @@ -51,7 +53,13 @@ let language: number | undefined = $state() async function submit() { - if (!profile.current?.user || !profile.current?.jwt || value == '') return + if ( + !profile.current?.user || + !profile.current?.jwt || + value == '' || + editing + ) + return loading = true