Browse Source

Save last used mensa in localStorage

master
Schneider 6 years ago
parent
commit
430a6c37d4
  1. 5
      src/App.vue
  2. 1
      src/store/index.js

5
src/App.vue

@ -95,6 +95,11 @@ export default {
} }
}, },
created() { created() {
let where = window.localStorage.getItem('mensa_where')
if (where !== null) {
this.where = where
}
this.$store.dispatch('loadMeals', { this.$store.dispatch('loadMeals', {
when: this.when, when: this.when,
where: this.where where: this.where

1
src/store/index.js

@ -13,6 +13,7 @@ const state = {
const mutations = { const mutations = {
updateWhere(state, where) { updateWhere(state, where) {
state.where = where state.where = where
window.localStorage.setItem('mensa_where', where)
}, },
updateWhen(state, when) { updateWhen(state, when) {

Loading…
Cancel
Save