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:
@@ -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',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user