aboutsummaryrefslogtreecommitdiff
path: root/src/modules/config.js
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2018-08-12 16:14:35 +0000
committerlambda <pleromagit@rogerbraun.net>2018-08-12 16:14:35 +0000
commit25be51e2c1d9ca7ab112682c59ffadd6d1b63276 (patch)
treeb04030b899850b503097c2df1e7fde2a13043a7f /src/modules/config.js
parentdb6ff4824afa7adca1f3b633278e9ed033d8671d (diff)
parent27adde9887d7205703ed461560f3272f6709b83b (diff)
Merge branch 'feature/accountHighlight' into 'develop'
Account highlight See merge request pleroma/pleroma-fe!285
Diffstat (limited to 'src/modules/config.js')
-rw-r--r--src/modules/config.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/modules/config.js b/src/modules/config.js
index 9a62905e..2b50655b 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -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,23 @@ const config = {
mutations: {
setOption (state, { name, value }) {
set(state, name, value)
+ },
+ setHighlight (state, { user, color, type }) {
+ const data = this.state.config.highlight[user]
+ if (color || type) {
+ set(state.highlight, user, { color: color || data.color, type: type || data.type })
+ } else {
+ del(state.highlight, user)
+ }
}
},
actions: {
setPageTitle ({state}, option = '') {
document.title = `${option} ${state.name}`
},
+ setHighlight ({ commit, dispatch }, { user, color, type }) {
+ commit('setHighlight', {user, color, type})
+ },
setOption ({ commit, dispatch }, { name, value }) {
commit('setOption', {name, value})
switch (name) {