mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fixes in tree loading
This commit is contained in:
		
							parent
							
								
									af4ea66742
								
							
						
					
					
						commit
						27be3b4c90
					
				@ -51,12 +51,12 @@ class TreeCache {
 | 
			
		||||
            if (!this.notes[noteId]) {
 | 
			
		||||
                messagingService.logError(`Can't find note ${noteId}`);
 | 
			
		||||
 | 
			
		||||
                return `[unknown ${noteId}]`;
 | 
			
		||||
                return null;
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                return this.notes[noteId];
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        }).filter(note => note !== null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** @return NoteShort */
 | 
			
		||||
 | 
			
		||||
@ -35,9 +35,9 @@ async function getTree() {
 | 
			
		||||
              JOIN tree ON branches.parentNoteId = tree.noteId
 | 
			
		||||
              WHERE tree.isExpanded = 1 AND branches.isDeleted = 0
 | 
			
		||||
          )
 | 
			
		||||
        SELECT branches.* FROM tree JOIN branches USING(noteId) ORDER BY branches.notePosition`);
 | 
			
		||||
        SELECT branches.* FROM tree JOIN branches USING(noteId) WHERE branches.isDeleted = 0 ORDER BY branches.notePosition`);
 | 
			
		||||
 | 
			
		||||
    const noteIds = branches.map(b => b.noteId);
 | 
			
		||||
    const noteIds = Array.from(new Set(branches.map(b => b.noteId)));
 | 
			
		||||
 | 
			
		||||
    const notes = await getNotes(noteIds);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ async function executeBundle(bundle, startNote, originEntity = null) {
 | 
			
		||||
        return await execute(ctx, script, '');
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        return await sql.transactional(async () => execute(ctx, script, ''));
 | 
			
		||||
        return await sql.transactional(async () => await execute(ctx, script, ''));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user