fix: Single frame blank flash when saving comments (#10362)

This commit is contained in:
Tom Moor authored and GitHub committed 2025-10-13 14:34:44 +00:00
1 parent b21d548d06
commit 3e58a6ca46
1 file changed
+4 -4
@@ -1,5 +1,5 @@
import { differenceInMilliseconds } from "date-fns";
import { action } from "mobx";
import { runInAction } from "mobx";
import { observer } from "mobx-react";
import { DoneIcon } from "outline-icons";
import { darken } from "polished";
@@ -179,18 +179,18 @@ function CommentThreadItem({
);
}, []);
const handleSubmit = action(async (event: React.FormEvent) => {
const handleSubmit = async (event: React.FormEvent) => {
event.preventDefault();
try {
handleSetReadOnly();
comment.data = data;
runInAction(() => (comment.data = data));
await comment.save();
} catch (_err) {
setEditing();
toast.error(t("Error updating comment"));
}
});
};
const handleCancel = () => {
setData(comment.data);