mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:39:01 +01: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": { |     "electron": { | ||||||
|       "version": "13.5.1", |       "version": "13.5.2", | ||||||
|       "resolved": "https://registry.npmjs.org/electron/-/electron-13.5.1.tgz", |       "resolved": "https://registry.npmjs.org/electron/-/electron-13.5.2.tgz", | ||||||
|       "integrity": "sha512-ZyxhIhmdaeE3xiIGObf0zqEyCyuIDqZQBv9NKX8w5FNzGm87j4qR0H1+GQg6vz+cA1Nnv1x175Zvimzc0/UwEQ==", |       "integrity": "sha512-CPakwDpy5m8dL0383F5uJboQcVtn9bT/+6/wdDKo8LuTUO9aER1TF41v7feZgZW2c+UwoGPWa814ElSQ3qta2A==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@electron/get": "^1.0.1", |         "@electron/get": "^1.0.1", | ||||||
| @ -2866,9 +2866,9 @@ | |||||||
|       }, |       }, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@types/node": { |         "@types/node": { | ||||||
|           "version": "14.17.20", |           "version": "14.17.21", | ||||||
|           "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.20.tgz", |           "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", | ||||||
|           "integrity": "sha512-gI5Sl30tmhXsqkNvopFydP7ASc4c2cLfGNQrVKN3X90ADFWFsPEsotm/8JHSUJQKTHbwowAHtcJPeyVhtKv0TQ==", |           "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", | ||||||
|           "dev": true |           "dev": true | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -81,7 +81,7 @@ | |||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "cross-env": "7.0.3", |     "cross-env": "7.0.3", | ||||||
|     "electron": "13.5.1", |     "electron": "13.5.2", | ||||||
|     "electron-builder": "22.13.1", |     "electron-builder": "22.13.1", | ||||||
|     "electron-packager": "15.4.0", |     "electron-packager": "15.4.0", | ||||||
|     "electron-rebuild": "3.2.3", |     "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."); |             this.$notePathIntro.text("This note is not yet placed into the note tree."); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         for (const notePathRecord of sortedNotePaths) { |         const printedNotePaths = new Set(); | ||||||
|             await this.addPath(notePathRecord); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     async addPath(notePathRecord) { |         for (const notePathRecord of sortedNotePaths) { | ||||||
|             const notePath = notePathRecord.notePath.join('/'); |             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 title = await treeService.getNotePathTitle(notePath); | ||||||
| 
 | 
 | ||||||
|         const $noteLink = await linkService.createNoteLink(notePath, {title}); |         const $noteLink = await linkService.createNoteLink(notePath, {title}); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam