fixed default values for multi-choice configurations, should also fix warnings

This commit is contained in:
Henry Jameson 2019-09-30 00:04:43 +03:00
parent 39b71e5dd6
commit 20fc259350
2 changed files with 19 additions and 4 deletions

View file

@ -10,6 +10,11 @@ import { instanceDefaultProperties, defaultState as configDefaultState } from '.
const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
const multiChoiceProperties = [
'postContentType',
'subjectLineBehavior'
]
const settings = {
data () {
const instance = this.$store.state.instance
@ -51,6 +56,16 @@ const settings = {
},
// Getting localized values for instance-default properties
...instanceDefaultProperties
.filter(key => multiChoiceProperties.includes(key))
.map(key => [
key + 'DefaultValue',
function () {
return this.$store.getters.instanceDefaultConfig[key]
}
])
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
...instanceDefaultProperties
.filter(key => !multiChoiceProperties.includes(key))
.map(key => [
key + 'LocalizedValue',
function () {