Apply dark mode setting at start (#42)

Closes: #40

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>

Reviewed-on: Georgi_Lab/ALVINN_f7#42
This commit is contained in:
2023-12-10 19:24:18 -07:00
parent b4864aa5ff
commit c805be725d

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',
}, },