Skip to content

Commit

Permalink
refactor: reset disclaimer addon state
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Feb 21, 2019
1 parent 4104345 commit 8120423
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/store/modules/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export default {
SET_DISCLAIMER (state, data) {
state.disclaimer = data
},
RESET_DISCLAIMER (state) {
state.disclaimer = data.addons.disclaimer
},
SET_MOBILE_APP (state, data) {
state.mobileApp[data.key] = { ...state.mobileApp[data.key], ...data.payload }
},
Expand All @@ -41,7 +44,7 @@ export default {
},
async removeAddon ({ state, commit, dispatch, rootState }, name) {
commit('REMOVE_ADDON', name)
if (name === 'disclaimer') commit('SET_DISCLAIMER', data.addons.disclaimer)
if (name === 'disclaimer') commit('RESET_DISCLAIMER')
if (name === 'mobileApp') commit('RESET_MOBILE_APP')
await dispatch('updateProject', rootState.projects.project)
},
Expand Down

0 comments on commit 8120423

Please sign in to comment.