1
0
mirror of https://github.com/kihashi/stardew_community_checklist.git synced 2025-10-19 08:03:17 +00:00

Fix reactivity problems.

This commit is contained in:
John Cleaver 2018-03-05 21:12:07 -05:00
parent 15ce32ff2c
commit bfb8a9701a

View File

@ -9,20 +9,15 @@ export default new Vuex.Store({
},
getters: {
IsBundleItemRedeemed: (state) => (BundleItem) => {
return state.StoredItems[BundleItem.bundle.id].hasOwnProperty(BundleItem.item.id)
return state.StoredItems.hasOwnProperty(BundleItem.id)
}
},
mutations: {
RedeemItem (state, BundleItem) {
state.StoredItems[BundleItem.bundle.id][BundleItem.item.id] = 1
Vue.set(state.StoredItems, BundleItem.id, 1)
},
UndoRedeemItem (state, BundleItem) {
delete state.StoredItems[BundleItem.bundle.id][BundleItem.item.id]
},
AddBundles (state, Bundles) {
for (let bundle of Bundles) {
state.StoredItems.set(bundle.id, {})
}
Vue.delete(state.StoredItems, BundleItem.id)
}
}
})