feat(safe): don't load themes if safe mode is active

This commit is contained in:
Elian Doran 2024-12-09 10:08:31 +02:00
parent 1b963e8b09
commit 8e65139c0f
No known key found for this signature in database

View File

@ -56,19 +56,20 @@ function index(req: Request, res: Response) {
function getThemeCssUrl(theme: string) {
if (theme === 'light') {
return false; // light theme is always loaded as baseline
// light theme is always loaded as baseline
return false;
} else if (theme === 'dark') {
return `${assetPath}/stylesheets/theme-dark.css`;
} else if (theme === "next") {
return `${assetPath}/stylesheets/theme-next.css`;
} else {
} else if (!process.env.TRILIUM_SAFE_MODE) {
const themeNote = attributeService.getNoteWithLabel('appTheme', theme);
if (themeNote) {
return `api/notes/download/${themeNote.noteId}`;
} else {
return false; // baseline light theme
}
} else {
// baseline light theme
return false;
}
}