Skip to content

Build your personal knowledge base with Trilium Notes

faster opening of the date notes (no animation)

zadam1bd769827d5f
diff --git a/db/demo.tar b/db/demo.tar
index 3cc749c92a..d5166d723a 100644
Binary files a/db/demo.tar and b/db/demo.tar differ
diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.js
index 2f8688f8be..146b6a5d65 100644
--- a/src/public/javascripts/desktop.js
+++ b/src/public/javascripts/desktop.js
@@ -117,7 +117,7 @@ $("body").on("click", "a.external", function () {
if (utils.isElectron()) {
require('electron').ipcRenderer.on('create-day-sub-note', async function(event) {
const todayNote = await dateNoteService.getTodayNote();
- const node = await treeService.expandToNote(todayNote.noteId);
+ const node = await treeService.expandToNote(todayNote.noteId, {noAnimation: true});
await treeService.createNote(node, todayNote.noteId, 'into', {
type: "text",
diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js
index 6233c070b9..3208244925 100644
--- a/src/public/javascripts/services/tree.js
+++ b/src/public/javascripts/services/tree.js
@@ -151,7 +151,7 @@ async function activateNote(notePath, noteLoadedListener) {
glob.activeDialog.modal('hide');
}
- const node = await expandToNote(notePath);
+ const node = await expandToNote(notePath, {noAnimation: true});
if (noteLoadedListener) {
noteDetailService.addDetailLoadedListener(node.data.noteId, noteLoadedListener);
diff --git a/src/public/javascripts/services/tree_cache.js b/src/public/javascripts/services/tree_cache.js
index bb24aa3932..b448654e1b 100644
--- a/src/public/javascripts/services/tree_cache.js
+++ b/src/public/javascripts/services/tree_cache.js
@@ -96,6 +96,10 @@ class TreeCache {
const resp = await server.post('tree/load', { noteIds: missingNoteIds });
this.addResp(resp.notes, resp.branches, resp.relations);
+
+ for (const note of resp.notes) {
+ await this.reloadParents(note.noteId);
+ }
}
return noteIds.map(noteId => {