aboutsummaryrefslogtreecommitdiff
path: root/src/modules/config.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2021-03-01 18:15:46 +0000
committerShpuld Shpludson <shp@cock.li>2021-03-01 18:15:46 +0000
commitc3fcbbd918ddef4e3f574a464fd10f4899bb2dce (patch)
tree695ccbd352c82cb0f08fc78ff85bf23888561a8e /src/modules/config.js
parent320418d524a33c20d7d769c8d67a25be81f251ec (diff)
parent0ac34b3014a1499ef5f3de7d3c321119dd10ab26 (diff)
Merge branch 'rc/2.3.0' into 'master'
2.3.0 to MASTER See merge request pleroma/pleroma-fe!1366
Diffstat (limited to 'src/modules/config.js')
-rw-r--r--src/modules/config.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/config.js b/src/modules/config.js
index cd088737..f992519e 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -76,18 +76,22 @@ export const instanceDefaultProperties = Object.entries(defaultState)
.map(([key, value]) => key)
const config = {
- state: defaultState,
+ state: { ...defaultState },
getters: {
- mergedConfig (state, getters, rootState, rootGetters) {
+ defaultConfig (state, getters, rootState, rootGetters) {
const { instance } = rootState
return {
- ...state,
- ...instanceDefaultProperties
- .map(key => [key, state[key] === undefined
- ? instance[key]
- : state[key]
- ])
- .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
+ ...defaultState,
+ ...Object.fromEntries(
+ instanceDefaultProperties.map(key => [key, instance[key]])
+ )
+ }
+ },
+ mergedConfig (state, getters, rootState, rootGetters) {
+ const { defaultConfig } = rootGetters
+ return {
+ ...defaultConfig,
+ ...state
}
}
},