fix: update text after save in note edit

This commit is contained in:
Artemy 2023-05-02 18:16:36 +03:00
parent cdbf75a332
commit cbc1e65fa1

View file

@ -97,15 +97,15 @@ function NotePage() {
text={edit ? locals.Save : locals.Edit} text={edit ? locals.Save : locals.Edit}
icon={edit ? ArchiveBoxArrowDownIcon : PencilIcon} icon={edit ? ArchiveBoxArrowDownIcon : PencilIcon}
onClick={() => { onClick={() => {
if (settings.CollabEdit === true) {
textUpdate(notes[params.id].text);
nameUpdate(notes[params.id].name);
}
if (edit) { if (edit) {
notes[params.id].name = name; notes[params.id].name = name;
notes[params.id].text = text; notes[params.id].text = text;
localStorage.setObj("Notes", notes); localStorage.setObj("Notes", notes);
} else {
if (settings.CollabEdit === true) {
textUpdate(notes[params.id].text);
nameUpdate(notes[params.id].name);
}
} }
setEdit(!edit); setEdit(!edit);