mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-20 10:16:43 -06:00
Fix toggleTheme method to update theme and store
it in local storage
This commit is contained in:
parent
af3f3f5736
commit
919d1726c5
@ -24,9 +24,7 @@
|
|||||||
<v-icon>mdi-cog</v-icon>
|
<v-icon>mdi-cog</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn @click="toggleTheme" icon>
|
<v-btn @click="toggleTheme" icon>
|
||||||
<v-icon>mdi-{{
|
<v-icon>mdi-{{ dark ? "white-balance-sunny" : "weather-night" }}</v-icon>
|
||||||
dark ? "white-balance-sunny" : "weather-night"
|
|
||||||
}}</v-icon>
|
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<SettingsModal ref="settings" />
|
<SettingsModal ref="settings" />
|
||||||
@ -48,9 +46,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleTheme() {
|
toggleTheme() {
|
||||||
this.theme.global.name = this.theme.global.current.dark
|
const theme = this.theme.global.current.dark ? "light" : "dark";
|
||||||
? "light"
|
this.theme.global.name = theme;
|
||||||
: "dark";
|
localStorage.setItem("theme", theme);
|
||||||
},
|
},
|
||||||
openSettings() {
|
openSettings() {
|
||||||
this.$refs.settings.open();
|
this.$refs.settings.open();
|
||||||
|
@ -11,9 +11,12 @@ import 'vuetify/styles'
|
|||||||
// Composables
|
// Composables
|
||||||
import { createVuetify } from 'vuetify'
|
import { createVuetify } from 'vuetify'
|
||||||
|
|
||||||
|
const defaultTheme = localStorage.getItem('theme') || 'light'
|
||||||
|
|
||||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||||
export default createVuetify({
|
export default createVuetify({
|
||||||
theme: {
|
theme: {
|
||||||
|
defaultTheme,
|
||||||
themes: {
|
themes: {
|
||||||
light: {
|
light: {
|
||||||
colors: {
|
colors: {
|
||||||
|
Loading…
Reference in New Issue
Block a user