From 20fc259350b6bc9163899b859b496b86cf0083c5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 30 Sep 2019 00:04:43 +0300 Subject: [PATCH] fixed default values for multi-choice configurations, should also fix warnings --- src/components/settings/settings.js | 15 +++++++++++++++ src/components/settings/settings.vue | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 3923fc60..a327ab28 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -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 () { diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 261efb7e..e1a06fe2 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -141,15 +141,15 @@ > @@ -173,7 +173,7 @@ :value="postFormat" > {{ $t(`post_status.content_type["${postFormat}"]`) }} - {{ postContentTypeLocalizedValue === postFormat ? $t('settings.instance_default_simple') : '' }} + {{ postContentTypeDefaultValue === postFormat ? $t('settings.instance_default_simple') : '' }}