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
Showing only changes of commit 241a0d73b0 - Show all commits

View File

@@ -41,11 +41,17 @@
setup() {
const device = getDevice();
// 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 = {
name: 'ALVINN', // App name
theme: 'auto', // Automatic theme detection
//autoDarkTheme: !(localStorage.getItem('openhab.ui:theme.dark')),
darkMode: 'auto',
darkMode: darkTheme,
colors: {
primary: '#002f65',
},