aboutsummaryrefslogtreecommitdiff
path: root/src/modules/instance.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-09-29 23:47:26 +0300
committerHenry Jameson <me@hjkos.com>2019-09-29 23:47:26 +0300
commit39b71e5dd6afef7c15b236c5c3d90984d2836d2e (patch)
tree74bd28dd048b8dc1f300bbd1f44584937c6c7f90 /src/modules/instance.js
parent979e170bd6880d0ee85bf0dd8898cf53d91055b5 (diff)
Removed all whole mess of manual watch/data declaration, now fully automatic
Diffstat (limited to 'src/modules/instance.js')
-rw-r--r--src/modules/instance.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 7d602aa1..0c1235ca 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -1,5 +1,6 @@
import { set } from 'vue'
import { setPreset } from '../services/style_setter/style_setter.js'
+import { instanceDefaultProperties } from './config.js'
const defaultState = {
// Stuff from static/config.json and apiConfig
@@ -72,6 +73,13 @@ const instance = {
}
}
},
+ getters: {
+ instanceDefaultConfig (state) {
+ return instanceDefaultProperties
+ .map(key => [key, state[key]])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
+ }
+ },
actions: {
setInstanceOption ({ commit, dispatch }, { name, value }) {
commit('setInstanceOption', { name, value })