From 8e65139c0f20b5912962bef6bfbc37703f43008d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 9 Dec 2024 10:08:31 +0200 Subject: [PATCH] feat(safe): don't load themes if safe mode is active --- src/routes/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index a37965b4c..60caf7ccc 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -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; } }