mirror of
https://github.com/outline/outline.git
synced 2026-12-05 18:55:10 +03:00
fix: Single frame blank flash when saving comments (#10362)
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user