mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 06:15:48 +01:00
fixes to note loading. Sidebar flickers way less after note change
This commit is contained in:
@@ -59,7 +59,6 @@ class Sidebar {
|
||||
}
|
||||
|
||||
this.widgets = [];
|
||||
this.$widgetContainer.empty();
|
||||
|
||||
const widgetClasses = (await Promise.all([
|
||||
import("../widgets/note_info.js"),
|
||||
@@ -95,15 +94,19 @@ class Sidebar {
|
||||
|
||||
this.widgets.sort((a, b) => a.getPosition() < b.getPosition() ? -1 : 1);
|
||||
|
||||
const widgetsToAppend = [];
|
||||
|
||||
for (const widget of this.widgets) {
|
||||
try {
|
||||
const $el = await widget.render();
|
||||
this.$widgetContainer.append($el);
|
||||
widgetsToAppend.push($el);
|
||||
}
|
||||
catch (e) {
|
||||
ws.logError(`Error while rendering widget ${widget.widgetName}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
this.$widgetContainer.empty().append(...widgetsToAppend);
|
||||
}
|
||||
|
||||
eventReceived(name, data) {
|
||||
|
||||
Reference in New Issue
Block a user