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:
parent
15ce32ff2c
commit
bfb8a9701a
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user