mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	add a check for root parent
This commit is contained in:
		
							parent
							
								
									1de06b4fc9
								
							
						
					
					
						commit
						bfa2b5fa62
					
				| @ -28,10 +28,7 @@ async function checkTreeCycles(errorList) { | |||||||
|         const childNoteId = row.noteId; |         const childNoteId = row.noteId; | ||||||
|         const parentNoteId = row.parentNoteId; |         const parentNoteId = row.parentNoteId; | ||||||
| 
 | 
 | ||||||
|         if (!childToParents[childNoteId]) { |         childToParents[childNoteId] = childToParents[childNoteId] || []; | ||||||
|             childToParents[childNoteId] = []; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         childToParents[childNoteId].push(parentNoteId); |         childToParents[childNoteId].push(parentNoteId); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -58,6 +55,10 @@ async function checkTreeCycles(errorList) { | |||||||
|     for (const noteId of noteIds) { |     for (const noteId of noteIds) { | ||||||
|         checkTreeCycle(noteId, [], errorList); |         checkTreeCycle(noteId, [], errorList); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     if (childToParents['root'].length !== 1 || childToParents['root'][0] !== 'none') { | ||||||
|  |         errorList.push('Incorrect root parent: ' + JSON.stringify(childToParents['root'])); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function runSyncRowChecks(table, key, errorList) { | async function runSyncRowChecks(table, key, errorList) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner