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
fix(client): don't reload the frontend after erasing notes
Elian Doran1d9a4fbf5bfa
diff --git a/apps/client/src/services/branches.spec.ts b/apps/client/src/services/branches.spec.tsindex f56fcf4865..b1542e2a46 100644--- a/apps/client/src/services/branches.spec.ts+++ b/apps/client/src/services/branches.spec.ts@@ -262,7 +262,7 @@ describe("deleteNotes", () => {expect(setNote).toHaveBeenCalledWith("root");});- it("asks for all clones, erases & reloads, and tolerates navigation errors", async () => {+ it("asks for all clones, erases without reloading, and tolerates navigation errors", async () => {const note = buildNote({ title: "Del3" });makeBranch("delBranch3", note.noteId, "root");@@ -282,7 +282,7 @@ describe("deleteNotes", () => {const [, body, componentId] = (server.post as any).mock.calls[0];expect(body).toMatchObject({ deleteAllClones: true, eraseNotes: true });expect(componentId).toBe("comp-9");- expect(reloadSpy).toHaveBeenCalledTimes(1);+ expect(reloadSpy).not.toHaveBeenCalled();expect(errSpy).toHaveBeenCalled();reloadSpy.mockRestore();errSpy.mockRestore();diff --git a/apps/client/src/services/branches.ts b/apps/client/src/services/branches.tsindex 98f8584999..997e2d0a58 100644--- a/apps/client/src/services/branches.ts+++ b/apps/client/src/services/branches.ts@@ -145,10 +145,6 @@ async function deleteNotes(branchIdsToDelete: string[], forceDeleteAllClones = ftaskId: utils.randomString(10)}, componentId);- if (eraseNotes) {- utils.reloadFrontendApp("erasing notes requires reload");- }-return true;}diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.htmlindex 12ce8c6389..89f8380c7c 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.html@@ -228,7 +228,7 @@only the current placement is removed and the note stays in its other locations.See <a class="reference-link" href="#root/_help_IakOLONlIfGI">Cloning Notes</a>.</li><li><em>Erase permanently</em> instead of the usual soft deletion. This cannot- be undone and reloads the application.</li>+ be undone.</li></ul><p>Notes deleted without erasing can be brought back, see <a class="reference-link"href="#root/_help_5Ct4MAJTS4tQ">Restoring Deleted Notes</a>.</p>diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.mdindex 718a0ec726..6654f8da1b 100644--- a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.md+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note menu.md@@ -91,7 +91,7 @@ The <span class="tn-icon bx bx-wrench"></span>_Advanced_ submenu groups the acti<span class="tn-icon bx bx-trash"></span>_Delete note_ opens the deletion dialog for the current note and its subtree. The dialog lists the notes that will be deleted and the relations that will be broken, and offers to:* Also delete the other clones of the note, if it is cloned elsewhere. Otherwise, only the current placement is removed and the note stays in its other locations. See <a class="reference-link" href="../Notes/Cloning%20Notes.md">Cloning Notes</a>.-* _Erase permanently_ instead of the usual soft deletion. This cannot be undone and reloads the application.+* _Erase permanently_ instead of the usual soft deletion. This cannot be undone.Notes deleted without erasing can be brought back, see <a class="reference-link" href="../Notes/Restoring%20Deleted%20Notes.md">Restoring Deleted Notes</a>.