diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 6eecebca..c146d60e 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -1,5 +1,14 @@ import _ from 'lodash' +export const getBooleanValue = value => { + if (value === 'true') { + return true + } else if (value === 'false') { + return false + } + return value +} + export const checkPartialUpdate = (settings, updatedSettings, description) => { return Object.keys(updatedSettings).reduce((acc, group) => { acc[group] = Object.keys(updatedSettings[group]).reduce((acc, key) => { diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index c0d62c6d..a756037b 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -132,7 +132,7 @@ import { RateLimitInput, RegInvitesInput, SelectInputWithReducedLabels } from './inputComponents' -import { processNested } from '@/store/modules/normalizers' +import { getBooleanValue, processNested } from '@/store/modules/normalizers' import _ from 'lodash' import marked from 'marked' @@ -332,9 +332,10 @@ export default { ) }, update(value, group, key, parents, input, type, nested) { + const updatedValue = getBooleanValue(value) nested - ? this.processNestedData(value, group, key, parents) - : this.updateSetting(value, group, key, input, type) + ? this.processNestedData(updatedValue, group, key, parents) + : this.updateSetting(updatedValue, group, key, input, type) }, updateSetting(value, group, key, input, type) { this.$store.dispatch('UpdateSettings', { group, key, input, value, type })