both bugs fixed. it's reactive and no more conflicting cards
This commit is contained in:
parent
fa8c221f3a
commit
8ccebbe156
7 changed files with 41 additions and 44 deletions
|
@ -1,4 +1,4 @@
|
|||
import { set } from 'vue'
|
||||
import { set, delete as del } from 'vue'
|
||||
import StyleSetter from '../services/style_setter/style_setter.js'
|
||||
|
||||
const defaultState = {
|
||||
|
@ -10,7 +10,8 @@ const defaultState = {
|
|||
autoLoad: true,
|
||||
streaming: false,
|
||||
hoverPreview: true,
|
||||
muteWords: []
|
||||
muteWords: [],
|
||||
highlight: {}
|
||||
}
|
||||
|
||||
const config = {
|
||||
|
@ -18,12 +19,22 @@ const config = {
|
|||
mutations: {
|
||||
setOption (state, { name, value }) {
|
||||
set(state, name, value)
|
||||
},
|
||||
setHighlight (state, { user, color }) {
|
||||
if (color) {
|
||||
set(state.highlight, user, color)
|
||||
} else {
|
||||
del(state.highlight, user)
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setPageTitle ({state}, option = '') {
|
||||
document.title = `${option} ${state.name}`
|
||||
},
|
||||
setHighlight ({ commit, dispatch }, { user, color }) {
|
||||
commit('setHighlight', {user, color})
|
||||
},
|
||||
setOption ({ commit, dispatch }, { name, value }) {
|
||||
commit('setOption', {name, value})
|
||||
switch (name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue