diff options
| author | Shpuld Shpludson <shp@cock.li> | 2021-03-01 18:15:46 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2021-03-01 18:15:46 +0000 |
| commit | c3fcbbd918ddef4e3f574a464fd10f4899bb2dce (patch) | |
| tree | 695ccbd352c82cb0f08fc78ff85bf23888561a8e /src/modules/config.js | |
| parent | 320418d524a33c20d7d769c8d67a25be81f251ec (diff) | |
| parent | 0ac34b3014a1499ef5f3de7d3c321119dd10ab26 (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.js | 22 |
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 } } }, |
