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
workaround for filter + create child problems
zadam1c5425c9ebfa
diff --git a/package-lock.json b/package-lock.jsonindex 857c1c6198..04ebdc121c 100644--- a/package-lock.json+++ b/package-lock.json@@ -1286,17 +1286,17 @@}},"async-mutex": {- "version": "0.2.4",- "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.2.4.tgz",- "integrity": "sha512-fcQKOXUKMQc57JlmjBCHtkKNrfGpHyR7vu18RfuLfeTAf4hK9PgOadPR5cDrBQ682zasrLUhJFe7EKAHJOduDg==",+ "version": "0.2.6",+ "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.2.6.tgz",+ "integrity": "sha512-Hs4R+4SPgamu6rSGW8C7cV9gaWUKEHykfzCCvIRuaVv636Ju10ZdeUbvb4TBEW0INuq2DHZqXbK4Nd3yG4RaRw==","requires": {"tslib": "^2.0.0"},"dependencies": {"tslib": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz",- "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g=="+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",+ "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="}}},diff --git a/package.json b/package.jsonindex de37763eb5..e34775212f 100644--- a/package.json+++ b/package.json@@ -24,7 +24,7 @@"test-all": "npm run test && npm run test-es6"},"dependencies": {- "async-mutex": "0.2.4",+ "async-mutex": "0.2.6","axios": "0.21.0","better-sqlite3": "7.1.1","body-parser": "1.19.0",diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex 082db164f9..7f9311835c 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -1123,6 +1123,11 @@ export default class NoteTreeWidget extends TabAwareWidget {await newActiveNode.setFocus(true);}}++ if (noteIdsToReload.size > 0 || noteIdsToUpdate.size > 0) {+ // workaround for https://github.com/mar10/fancytree/issues/1054+ this.filterHoistedBranch();+ }}sortChildren(node) {@@ -1185,7 +1190,12 @@ export default class NoteTreeWidget extends TabAwareWidget {filterHoistedBranch() {if (this.tabContext) {- this.tree.filterBranches(node => node.data.noteId === this.tabContext.hoistedNoteId);+ if (this.tabContext.hoistedNoteId === 'root') {+ this.tree.clearFilter();+ }+ else {+ this.tree.filterBranches(node => node.data.noteId === this.tabContext.hoistedNoteId);+ }}}