theme saved and works

This commit is contained in:
Ben Arc
2021-06-30 12:40:58 +01:00
parent 40f50135bb
commit 4e43d2d52e
2 changed files with 7 additions and 2 deletions

View File

@@ -307,7 +307,8 @@ window.windowMixin = {
extensions: [],
user: null,
wallet: null,
payments: []
payments: [],
}
}
},
@@ -317,6 +318,7 @@ window.windowMixin = {
document.body.setAttribute('data-theme', newValue)
console.log(document.body.getAttribute('data-theme'))
console.log(newValue)
this.$q.localStorage.set('lnbits.theme', newValue)
},
toggleDarkMode: function () {
this.$q.dark.toggle()
@@ -334,6 +336,9 @@ window.windowMixin = {
},
created: function () {
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'))
if (this.$q.localStorage.getItem('lnbits.theme')){
document.body.setAttribute('data-theme', this.$q.localStorage.getItem('lnbits.theme'))
}
if (window.user) {
this.g.user = Object.freeze(window.LNbits.map.user(window.user))
}

View File

@@ -29,7 +29,7 @@ $themes: (
@each $name, $color in $colors {
@if $name == 'dark' {
[data-theme='#{$theme}'] .q-drawer--dark,
body.body--dark [data-theme='#{$theme}'] .q-layout,
body[data-theme='#{$theme}'].body--dark,
[data-theme='#{$theme}'] .q-menu--dark {
background: $color !important;
}