mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
custom widget launchers should not be initialized in safe mode
This commit is contained in:
parent
b13ea72152
commit
4c51588270
@ -37,6 +37,10 @@ export default class LauncherWidget extends BasicWidget {
|
|||||||
|
|
||||||
const launcherType = note.getLabelValue("launcherType");
|
const launcherType = note.getLabelValue("launcherType");
|
||||||
|
|
||||||
|
if (glob.TRILIUM_SAFE_MODE && launcherType === 'customWidget') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (launcherType === 'command') {
|
if (launcherType === 'command') {
|
||||||
this.innerWidget = this.initCommandLauncherWidget(note)
|
this.innerWidget = this.initCommandLauncherWidget(note)
|
||||||
.class("launcher-button");
|
.class("launcher-button");
|
||||||
|
@ -27,9 +27,7 @@ export default class LauncherContainer extends FlexContainer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.allSettled(
|
for (const launcherNote of await visibleLaunchersRoot.getChildNotes()) {
|
||||||
(await visibleLaunchersRoot.getChildNotes())
|
|
||||||
.map(async launcherNote => {
|
|
||||||
try {
|
try {
|
||||||
const launcherWidget = new LauncherWidget();
|
const launcherWidget = new LauncherWidget();
|
||||||
const success = await launcherWidget.initLauncher(launcherNote);
|
const success = await launcherWidget.initLauncher(launcherNote);
|
||||||
@ -41,8 +39,7 @@ export default class LauncherContainer extends FlexContainer {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
);
|
|
||||||
|
|
||||||
this.$widget.empty();
|
this.$widget.empty();
|
||||||
this.renderChildren();
|
this.renderChildren();
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
extraHoistedNoteId: '<%= extraHoistedNoteId %>',
|
extraHoistedNoteId: '<%= extraHoistedNoteId %>',
|
||||||
isProtectedSessionAvailable: <%= isProtectedSessionAvailable %>,
|
isProtectedSessionAvailable: <%= isProtectedSessionAvailable %>,
|
||||||
triliumVersion: "<%= triliumVersion %>",
|
triliumVersion: "<%= triliumVersion %>",
|
||||||
assetPath: "<%= assetPath %>"
|
assetPath: "<%= assetPath %>",
|
||||||
|
TRILIUM_SAFE_MODE: <%= !!process.env.TRILIUM_SAFE_MODE %>
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -117,7 +117,8 @@
|
|||||||
appCssNoteIds: <%- JSON.stringify(appCssNoteIds) %>,
|
appCssNoteIds: <%- JSON.stringify(appCssNoteIds) %>,
|
||||||
isProtectedSessionAvailable: <%= isProtectedSessionAvailable %>,
|
isProtectedSessionAvailable: <%= isProtectedSessionAvailable %>,
|
||||||
assetPath: "<%= assetPath %>",
|
assetPath: "<%= assetPath %>",
|
||||||
isMainWindow: true
|
isMainWindow: true,
|
||||||
|
TRILIUM_SAFE_MODE: <%= !!process.env.TRILIUM_SAFE_MODE %>
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user