diff options
Diffstat (limited to 'src/modules/config.js')
| -rw-r--r-- | src/modules/config.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/config.js b/src/modules/config.js index 20e58250..2d597640 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -20,9 +20,12 @@ const config = { setOption (state, { name, value }) { set(state, name, value) }, - setHighlight (state, { user, color }) { - if (color) { - set(state.highlight, user, color) + setHighlight (state, { user, color, type }) { + const data = this.state.config.highlight[user] + console.log(user, color, type, data) + + if (color || type) { + set(state.highlight, user, { color: color || data.color, type: type || data.type }) } else { del(state.highlight, user) } @@ -32,8 +35,8 @@ const config = { setPageTitle ({state}, option = '') { document.title = `${option} ${state.name}` }, - setHighlight ({ commit, dispatch }, { user, color }) { - commit('setHighlight', {user, color}) + setHighlight ({ commit, dispatch }, { user, color, type }) { + commit('setHighlight', {user, color, type}) }, setOption ({ commit, dispatch }, { name, value }) { commit('setOption', {name, value}) |
