Skip to content

Commit

Permalink
MT: Microvolunteering loop hangs browser
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Mar 18, 2022
1 parent 45b516d commit 5c57e14
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions store/microvolunteering.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export const mutations = {
}
},

addList(state, list) {
state.list = {}

if (list) {
for (const item of list) {
Vue.set(state.list, item.id, item)
}
}
},

clear(state) {
state.list = {}
},
Expand Down Expand Up @@ -48,10 +58,7 @@ export const actions = {
microvolunteerings
} = await this.$api.microvolunteering.fetch(params)

microvolunteerings.forEach(m => {
commit('add', m)
})

commit('addList', microvolunteerings)
return context
},

Expand Down

0 comments on commit 5c57e14

Please sign in to comment.