mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-13 15:14:49 -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-btn>
|
||||
<v-btn @click="toggleTheme" icon>
|
||||
<v-icon>mdi-{{
|
||||
dark ? "white-balance-sunny" : "weather-night"
|
||||
}}</v-icon>
|
||||
<v-icon>mdi-{{ dark ? "white-balance-sunny" : "weather-night" }}</v-icon>
|
||||
</v-btn>
|
||||
</v-app-bar>
|
||||
<SettingsModal ref="settings" />
|
||||
@ -48,9 +46,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toggleTheme() {
|
||||
this.theme.global.name = this.theme.global.current.dark
|
||||
? "light"
|
||||
: "dark";
|
||||
const theme = this.theme.global.current.dark ? "light" : "dark";
|
||||
this.theme.global.name = theme;
|
||||
localStorage.setItem("theme", theme);
|
||||
},
|
||||
openSettings() {
|
||||
this.$refs.settings.open();
|
||||
|
@ -11,9 +11,12 @@ import 'vuetify/styles'
|
||||
// Composables
|
||||
import { createVuetify } from 'vuetify'
|
||||
|
||||
const defaultTheme = localStorage.getItem('theme') || 'light'
|
||||
|
||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||
export default createVuetify({
|
||||
theme: {
|
||||
defaultTheme,
|
||||
themes: {
|
||||
light: {
|
||||
colors: {
|
||||
|
Loading…
Reference in New Issue
Block a user