mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
feat(safe): don't load themes if safe mode is active
This commit is contained in:
parent
1b963e8b09
commit
8e65139c0f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user