mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
improvements in search UI
This commit is contained in:
@@ -2,6 +2,7 @@ import Branch from "../entities/branch.js";
|
||||
import NoteShort from "../entities/note_short.js";
|
||||
import Attribute from "../entities/attribute.js";
|
||||
import server from "./server.js";
|
||||
import appContext from "./app_context.js";
|
||||
import NoteComplement from "../entities/note_complement.js";
|
||||
|
||||
/**
|
||||
@@ -192,8 +193,12 @@ class TreeCache {
|
||||
await this.loadParents(resp, true);
|
||||
this.addResp(resp);
|
||||
|
||||
const searchNoteIds = [];
|
||||
|
||||
for (const note of resp.notes) {
|
||||
if (note.type === 'search') {
|
||||
searchNoteIds.push(note.noteId);
|
||||
|
||||
const searchResultNoteIds = await server.get('search-note/' + note.noteId);
|
||||
|
||||
if (!Array.isArray(searchResultNoteIds)) {
|
||||
@@ -227,6 +232,10 @@ class TreeCache {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (searchNoteIds.length > 0) {
|
||||
appContext.triggerEvent('searchResultsUpdated', {searchNoteIds});
|
||||
}
|
||||
}
|
||||
|
||||
/** @return {NoteShort[]} */
|
||||
|
||||
Reference in New Issue
Block a user