Clear notes from vuex store when logging out
This commit is contained in:
parent
dbf3b4344d
commit
c4f95179c9
@ -50,6 +50,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async logout() {
|
||||
this.$store.commit('notes/clear')
|
||||
await this.$auth.logout()
|
||||
},
|
||||
toggleTheme() {
|
||||
|
||||
@ -12,6 +12,10 @@ export const mutations = {
|
||||
delete(state, uuid) {
|
||||
state.notes = state.notes.filter((e) => e.uuid !== uuid)
|
||||
},
|
||||
// used when logging out
|
||||
clear(state) {
|
||||
state.notes = []
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user