small refactorings and fixes

This commit is contained in:
zadam
2023-06-29 23:32:19 +02:00
parent 48029cea7c
commit eb34f9c64f
45 changed files with 78 additions and 188 deletions

View File

@@ -15,7 +15,7 @@ const appPath = require("../services/app_path");
function index(req, res) {
const options = optionService.getOptionMap();
let view = (!utils.isElectron() && req.cookies['trilium-device'] === 'mobile')
const view = (!utils.isElectron() && req.cookies['trilium-device'] === 'mobile')
? 'mobile'
: 'desktop';
@@ -47,18 +47,14 @@ function index(req, res) {
function getThemeCssUrl(theme) {
if (theme === 'light') {
return false; // light theme is always loaded as baseline
}
if (theme === 'dark') {
} else if (theme === 'dark') {
return `${assetPath}/stylesheets/theme-dark.css`;
}
else {
} else {
const themeNote = attributeService.getNoteWithLabel('appTheme', theme);
if (themeNote) {
return `api/notes/download/${themeNote.noteId}`;
}
else {
} else {
return false; // baseline light theme
}
}