mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
initial load of tabs can run partially asynchronously to speed things up
This commit is contained in:
@@ -275,12 +275,19 @@ async function loadNoteDetail(origNotePath, options = {}) {
|
||||
if (!newTab && currentTreeNode && currentTreeNode.data.noteId !== loadedNote.noteId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const loadPromise = loadNoteDetailToContext(ctx, loadedNote, notePath).then(() => {
|
||||
if (activate) {
|
||||
// will also trigger showTab via event
|
||||
return tabRow.activateTab(ctx.$tab[0]);
|
||||
}
|
||||
else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
|
||||
await loadNoteDetailToContext(ctx, loadedNote, notePath);
|
||||
|
||||
if (activate) {
|
||||
// will also trigger showTab via event
|
||||
await tabRow.activateTab(ctx.$tab[0]);
|
||||
if (!options.async) {
|
||||
await loadPromise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user