mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
filter out duplicated note paths, fixes #2218
This commit is contained in:
parent
1ad25b063d
commit
ec732c0a98
12
package-lock.json
generated
12
package-lock.json
generated
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -83,14 +83,22 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||
this.$notePathIntro.text("This note is not yet placed into the note tree.");
|
||||
}
|
||||
|
||||
for (const notePathRecord of sortedNotePaths) {
|
||||
await this.addPath(notePathRecord);
|
||||
}
|
||||
}
|
||||
const printedNotePaths = new Set();
|
||||
|
||||
async addPath(notePathRecord) {
|
||||
for (const notePathRecord of sortedNotePaths) {
|
||||
const notePath = notePathRecord.notePath.join('/');
|
||||
|
||||
if (printedNotePaths.has(notePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
printedNotePaths.add(notePath);
|
||||
|
||||
await this.addPath(notePath, notePathRecord);
|
||||
}
|
||||
}
|
||||
|
||||
async addPath(notePath, notePathRecord) {
|
||||
const title = await treeService.getNotePathTitle(notePath);
|
||||
|
||||
const $noteLink = await linkService.createNoteLink(notePath, {title});
|
||||
|
Loading…
x
Reference in New Issue
Block a user