logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 2da37f15ab6a7e0c6088a6e5a0b2c2885f1cb85a
parent 8e88d8110b0e52023c7f78777bda1951a1bc8d8b
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 11 Mar 2021 17:04:31 +0200

Cleanup boolean/choice setting

Diffstat:

Msrc/components/settings_modal/helpers/boolean_setting.vue38+-------------------------------------
Msrc/components/settings_modal/helpers/choice_setting.vue2+-
2 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue @@ -18,40 +18,4 @@ </label> </template> -<script> -import { get, set } from 'lodash' -import Checkbox from 'src/components/checkbox/checkbox.vue' -import ModifiedIndicator from './modified_indicator.vue' -export default { - components: { - Checkbox, - ModifiedIndicator - }, - props: [ - 'path', - 'disabled' - ], - computed: { - pathDefault () { - const [firstSegment, ...rest] = this.path.split('.') - return [firstSegment + 'DefaultValue', ...rest].join('.') - }, - state () { - return get(this.$parent, this.path) - }, - isChanged () { - return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault) - } - }, - methods: { - update (e) { - set(this.$parent, this.path, e) - } - } -} -</script> - -<style lang="scss"> -.BooleanSetting { -} -</style> +<script src="./boolean_setting.js"></script> diff --git a/src/components/settings_modal/helpers/choice_setting.vue b/src/components/settings_modal/helpers/choice_setting.vue @@ -14,7 +14,7 @@ :value="option.value" > {{ option.label }} - {{ option.value === defaultValue ? $t('settings.instance_default_simple') : '' }} + {{ option.value === defaultState ? $t('settings.instance_default_simple') : '' }} </option> </Select> <ModifiedIndicator :changed="isChanged" />