Move dark mode toggle to account page

This commit is contained in:
Kevin Thomas
2022-04-05 21:32:45 -07:00
parent 7127e473b8
commit 7a59000a41
4 changed files with 11 additions and 13 deletions

View File

@@ -77,6 +77,12 @@
</v-form> </v-form>
</v-dialog> </v-dialog>
<v-switch
v-model="$vuetify.theme.dark"
label="Dark Mode"
@change="toggleDarkMode"
/>
<v-snackbar <v-snackbar
v-model="snackbar" v-model="snackbar"
timeout="3000" timeout="3000"

View File

@@ -61,14 +61,6 @@
Logout Logout
</v-list-item-title> </v-list-item-title>
</v-list-item> </v-list-item>
<v-list-item>
<v-switch
v-model="$vuetify.theme.dark"
label="Dark Mode"
:disabled="!loggedIn"
@change="toggleDarkMode"
/>
</v-list-item>
</v-list-item-group> </v-list-item-group>
</v-list> </v-list>
<template v-slot:append> <template v-slot:append>

View File

@@ -40,6 +40,11 @@ export default {
if (this.$refs.changePasswordForm) { if (this.$refs.changePasswordForm) {
this.$refs.changePasswordForm.reset() this.$refs.changePasswordForm.reset()
} }
},
toggleDarkMode () {
this.$http.patch('/users/dark-mode', {
darkMode: this.$vuetify.theme.dark
})
} }
} }
} }

View File

@@ -38,11 +38,6 @@ export default {
.catch(() => { .catch(() => {
this.isAdmin = false this.isAdmin = false
}) })
},
toggleDarkMode () {
this.$http.patch('/users/dark-mode', {
darkMode: this.$vuetify.theme.dark
})
} }
} }
} }