Add back checkbox selection
This commit is contained in:
parent
b12cd676a9
commit
cea7bc4e06
1 changed files with 16 additions and 8 deletions
|
|
@ -1240,18 +1240,26 @@ const Notes: React.FC = () => {
|
|||
// Save to backend
|
||||
if (previewNote.uid) {
|
||||
try {
|
||||
const savedNote = await updateNote(
|
||||
previewNote.uid,
|
||||
updatedNote
|
||||
);
|
||||
const savedNote =
|
||||
await updateNote(
|
||||
previewNote.uid,
|
||||
updatedNote
|
||||
);
|
||||
// Update notes list
|
||||
const updatedNotes = notes.map((n) =>
|
||||
n.uid === previewNote.uid ? savedNote : n
|
||||
);
|
||||
const updatedNotes =
|
||||
notes.map((n) =>
|
||||
n.uid ===
|
||||
previewNote.uid
|
||||
? savedNote
|
||||
: n
|
||||
);
|
||||
setNotes(updatedNotes);
|
||||
setPreviewNote(savedNote);
|
||||
} catch (err) {
|
||||
console.error('Error updating note:', err);
|
||||
console.error(
|
||||
'Error updating note:',
|
||||
err
|
||||
);
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue