From fa0023e54168624bebd6cdd479c1df0e63cb868d Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 21 Jun 2019 15:11:56 +0900 Subject: [PATCH] Fix bug --- src/client/app/common/views/deck/deck.vue | 5 +---- src/client/app/store.ts | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client/app/common/views/deck/deck.vue b/src/client/app/common/views/deck/deck.vue index 070312d839..36e0f8161e 100644 --- a/src/client/app/common/views/deck/deck.vue +++ b/src/client/app/common/views/deck/deck.vue @@ -106,10 +106,7 @@ export default Vue.extend({ deck.layout = deck.columns.map(c => [c.id]); - this.$store.commit('device/set', { - key: 'deck', - value: deck - }); + this.$store.commit('setDeck', deck); } }, diff --git a/src/client/app/store.ts b/src/client/app/store.ts index b06edb1ed9..852d2c393d 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -129,6 +129,11 @@ export default (os: MiOS) => new Vuex.Store({ os.store.dispatch('settings/updateHomeProfile'); }, + setDeck(state, data) { + Vue.set(state.settings.deckProfiles, state.device.deckProfile, data); + os.store.dispatch('settings/updateDeckProfile'); + }, + addHomeWidget(state, widget) { state.settings.homeProfiles[state.device.homeProfile].unshift(widget); os.store.dispatch('settings/updateHomeProfile');