Update settings.js

pull/2723/head
stweedo 2023-05-05 13:32:11 -05:00 committed by GitHub
parent 134ef22606
commit 52c8df698b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,12 @@
require('Storage').writeJSON(LOC, appSettings); require('Storage').writeJSON(LOC, appSettings);
} }
// Sync theme with current Bangle.js theme
function syncTheme() {
let sysSettings = require('Storage').readJSON(SYS, 1) || {};
appSettings.theme = sysSettings.theme && sysSettings.theme.dark ? 'dark' : 'light';
}
// Switch theme and save to storage // Switch theme and save to storage
function switchTheme(mode) { function switchTheme(mode) {
if (mode === g.theme.dark) return; if (mode === g.theme.dark) return;
@ -30,6 +36,9 @@
if (Bangle.CLOCK) load(global.__FILE__); if (Bangle.CLOCK) load(global.__FILE__);
} }
// Sync theme before showing settings menu
syncTheme();
// Show settings menu // Show settings menu
E.showMenu({ E.showMenu({
"": {"title": "Shadow Clock"}, "": {"title": "Shadow Clock"},