Skip to content
Snippets Groups Projects
Commit 45798b60 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

use actions

parent 82ec1c94
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ export default {
},
resetStore: function() {
this.$store.commit("resetStore")
this.$store.dispatch("resetStore")
}
}
......
......@@ -34,13 +34,6 @@ const store = new Vuex.Store({
state.showInflectionNo = localStorage.getItem('showInflectionNo') || false
state.currentLocale = localStorage.getItem('currentLocale') || {text:"nob", value: "nob"}
},
resetStore(state) {
localStorage.removeItem("showSearchToolbar")
localStorage.removeItem("showHGNO")
localStorage.removeItem("showInflectionNo")
localStorage.removeItem("currentLocale")
this.commit("initStore", state)
},
changeLocale(state, locale) {
state.currentLocale = locale
localStorage.setItem("currentLocale", locale);
......@@ -50,6 +43,15 @@ const store = new Vuex.Store({
state[setting] = value
localStorage.setItem(setting, value);
}
},
actions: {
resetStore(context) {
localStorage.removeItem("showSearchToolbar")
localStorage.removeItem("showHGNO")
localStorage.removeItem("showInflectionNo")
localStorage.removeItem("currentLocale")
context.commit("initStore", context)
},
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment