edited notes: do not shadow variable

https://github.com/TriliumNext/Trilium/pull/7704#discussion_r2532135842
This commit is contained in:
contributor 2025-11-16 20:27:04 +02:00
parent 00770dc45a
commit d3c0e8b9da

View File

@ -13,10 +13,10 @@ export default function EditedNotesTab({ note }: TabContext) {
useEffect(() => {
if (!note) return;
server.get<EditedNotesResponse>(`edited-notes/${note.getLabelValue("dateNote")}`).then(async response => {
const editedNotes = response.notes.filter((n) => n.noteId !== note.noteId);
const noteIds = editedNotes.flatMap((n) => n.noteId);
const filteredNotes = response.notes.filter((n) => n.noteId !== note.noteId);
const noteIds = filteredNotes.flatMap((n) => n.noteId);
await froca.getNotes(noteIds, true); // preload all at once
setEditedNotes(editedNotes);
setEditedNotes(filteredNotes);
});
}, [ note?.noteId ]);