Update settings.js

Added fallback to application theme setting if it can't read system theme setting
master
stweedo 2023-05-07 23:49:12 -05:00 committed by GitHub
parent e81259e2c4
commit 4cac535960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,9 @@
// Read the current system theme // Read the current system theme
function getCurrentTheme() { function getCurrentTheme() {
let s = require('Storage').readJSON("setting.json", 1) || {}; let s = require('Storage').readJSON("setting.json", 1) || {};
if (!s.theme) {
return appSettings.theme; // fallback to appSettings.theme (light or dark)
}
return s.theme.dark ? 'dark' : 'light'; return s.theme.dark ? 'dark' : 'light';
} }