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
filter out duplicated note paths, fixes #2218
zadamec732c0a98db
diff --git a/package-lock.json b/package-lock.jsonindex 42900b8ac3..0fc7a875c2 100644--- a/package-lock.json+++ b/package-lock.json@@ -2855,9 +2855,9 @@}},"electron": {- "version": "13.5.1",- "resolved": "https://registry.npmjs.org/electron/-/electron-13.5.1.tgz",- "integrity": "sha512-ZyxhIhmdaeE3xiIGObf0zqEyCyuIDqZQBv9NKX8w5FNzGm87j4qR0H1+GQg6vz+cA1Nnv1x175Zvimzc0/UwEQ==",+ "version": "13.5.2",+ "resolved": "https://registry.npmjs.org/electron/-/electron-13.5.2.tgz",+ "integrity": "sha512-CPakwDpy5m8dL0383F5uJboQcVtn9bT/+6/wdDKo8LuTUO9aER1TF41v7feZgZW2c+UwoGPWa814ElSQ3qta2A==","dev": true,"requires": {"@electron/get": "^1.0.1",@@ -2866,9 +2866,9 @@},"dependencies": {"@types/node": {- "version": "14.17.20",- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.20.tgz",- "integrity": "sha512-gI5Sl30tmhXsqkNvopFydP7ASc4c2cLfGNQrVKN3X90ADFWFsPEsotm/8JHSUJQKTHbwowAHtcJPeyVhtKv0TQ==",+ "version": "14.17.21",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz",+ "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==","dev": true}}diff --git a/package.json b/package.jsonindex 5505c463f4..f5e385d5fc 100644--- a/package.json+++ b/package.json@@ -81,7 +81,7 @@},"devDependencies": {"cross-env": "7.0.3",- "electron": "13.5.1",+ "electron": "13.5.2","electron-builder": "22.13.1","electron-packager": "15.4.0","electron-rebuild": "3.2.3",diff --git a/src/public/app/widgets/ribbon_widgets/note_paths.js b/src/public/app/widgets/ribbon_widgets/note_paths.jsindex 3e22657a00..6d05ee4a0d 100644--- a/src/public/app/widgets/ribbon_widgets/note_paths.js+++ b/src/public/app/widgets/ribbon_widgets/note_paths.js@@ -83,14 +83,22 @@ export default class NotePathsWidget extends NoteContextAwareWidget {this.$notePathIntro.text("This note is not yet placed into the note tree.");}+ const printedNotePaths = new Set();+for (const notePathRecord of sortedNotePaths) {- await this.addPath(notePathRecord);+ const notePath = notePathRecord.notePath.join('/');++ if (printedNotePaths.has(notePath)) {+ continue;+ }++ printedNotePaths.add(notePath);++ await this.addPath(notePath, notePathRecord);}}- async addPath(notePathRecord) {- const notePath = notePathRecord.notePath.join('/');-+ async addPath(notePath, notePathRecord) {const title = await treeService.getNotePathTitle(notePath);const $noteLink = await linkService.createNoteLink(notePath, {title});