Apply dark mode setting at start #42

Merged
jgeorgi merged 1 commits from xps-dark-fix into main 2023-12-11 02:24:18 +00:00

View File

@@ -41,11 +41,17 @@
setup() { setup() {
const device = getDevice(); const device = getDevice();
// Framework7 Parameters // Framework7 Parameters
var loadThemeSettings = localStorage.getItem('themeSettings')
if (loadThemeSettings) var themeSettings = JSON.parse(loadThemeSettings)
try {
var darkTheme = themeSettings.darkMode.toString()
} catch {
var darkTheme = 'auto'
}
const f7params = { const f7params = {
name: 'ALVINN', // App name name: 'ALVINN', // App name
theme: 'auto', // Automatic theme detection theme: 'auto', // Automatic theme detection
//autoDarkTheme: !(localStorage.getItem('openhab.ui:theme.dark')), darkMode: darkTheme,
darkMode: 'auto',
colors: { colors: {
primary: '#002f65', primary: '#002f65',
}, },