chore: share view logic responsability
This commit is contained in:
@@ -4,7 +4,7 @@ import moment from 'moment'
|
||||
const mutations = {
|
||||
closeHovers: state => {
|
||||
state.show = null
|
||||
state.showMessage = null
|
||||
state.showConfirm = null
|
||||
},
|
||||
toggleShell: (state) => {
|
||||
state.showShell = !state.showShell
|
||||
@@ -16,16 +16,13 @@ const mutations = {
|
||||
}
|
||||
|
||||
state.show = value.prompt
|
||||
state.showMessage = value.message
|
||||
state.showConfirm = value.confirm
|
||||
},
|
||||
showError: (state, value) => {
|
||||
showError: (state) => {
|
||||
state.show = 'error'
|
||||
state.showMessage = value
|
||||
},
|
||||
showSuccess: (state, value) => {
|
||||
showSuccess: (state) => {
|
||||
state.show = 'success'
|
||||
state.showMessage = value
|
||||
},
|
||||
setLoading: (state, value) => { state.loading = value },
|
||||
setReload: (state, value) => { state.reload = value },
|
||||
@@ -46,12 +43,8 @@ const mutations = {
|
||||
state.user = value
|
||||
},
|
||||
setJWT: (state, value) => (state.jwt = value),
|
||||
setToken: (state, value ) => (state.token = value),
|
||||
multiple: (state, value) => (state.multiple = value),
|
||||
addSelected: (state, value) => (state.selected.push(value)),
|
||||
addPlugin: (state, value) => {
|
||||
state.plugins.push(value)
|
||||
},
|
||||
removeSelected: (state, value) => {
|
||||
let i = state.selected.indexOf(value)
|
||||
if (i === -1) return
|
||||
@@ -84,8 +77,7 @@ const mutations = {
|
||||
resetClipboard: (state) => {
|
||||
state.clipboard.key = ''
|
||||
state.clipboard.items = []
|
||||
},
|
||||
setHash: (state, value) => (state.hash = value),
|
||||
}
|
||||
}
|
||||
|
||||
export default mutations
|
||||
|
||||
Reference in New Issue
Block a user