mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 06:15:48 +01:00
make initialization of launchers more robust
This commit is contained in:
@@ -17,8 +17,6 @@ export default class LauncherContainer extends FlexContainer {
|
||||
async load() {
|
||||
await froca.initializedPromise;
|
||||
|
||||
this.children = [];
|
||||
|
||||
const visibleLaunchersRoot = await froca.getNote('_lbVisibleLaunchers', true);
|
||||
|
||||
if (!visibleLaunchersRoot) {
|
||||
@@ -27,13 +25,15 @@ export default class LauncherContainer extends FlexContainer {
|
||||
return;
|
||||
}
|
||||
|
||||
const newChildren = [];
|
||||
|
||||
for (const launcherNote of await visibleLaunchersRoot.getChildNotes()) {
|
||||
try {
|
||||
const launcherWidget = new LauncherWidget();
|
||||
const success = await launcherWidget.initLauncher(launcherNote);
|
||||
|
||||
if (success) {
|
||||
this.child(launcherWidget);
|
||||
newChildren.push(launcherWidget);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
@@ -41,6 +41,9 @@ export default class LauncherContainer extends FlexContainer {
|
||||
}
|
||||
}
|
||||
|
||||
this.children = [];
|
||||
this.child(...newChildren);
|
||||
|
||||
this.$widget.empty();
|
||||
this.renderChildren();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user