Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(test): notify listeners with a loop
Elian Doranadea91160d72
diff --git a/apps/client/src/widgets/search_result.spec.tsx b/apps/client/src/widgets/search_result.spec.tsxindex 61d0b81579..665cec07bd 100644--- a/apps/client/src/widgets/search_result.spec.tsx+++ b/apps/client/src/widgets/search_result.spec.tsx@@ -24,7 +24,11 @@ vi.mock("./react/hooks", async (importOriginal) => {// Several components call this; notify them all, so the top-level widget re-renders too.const listener = () => setNote(shownNote.current);shownNote.listeners.add(listener);- shownNote.notify = () => shownNote.listeners.forEach((notify) => notify());+ shownNote.notify = () => {+ for (const notify of shownNote.listeners) {+ notify();+ }+ };return () => {shownNote.listeners.delete(listener);};