aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/helpers/boolean_setting.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2021-07-19 16:11:11 +0000
committerShpuld Shpludson <shp@cock.li>2021-07-19 16:11:11 +0000
commit373b14e1e4cdab415eb2cc21108cedbf3c21fe6f (patch)
treee6dd1a5c7fb04c12e7fd29ca2c9b21e15eb18243 /src/components/settings_modal/helpers/boolean_setting.js
parent19475ba356c3fd6c54ca0306d3ae392358c212d1 (diff)
parent32d1a0e1813e706a298871361123636187cde9bc (diff)
Merge branch 'fix-settings-anon' into 'develop'
Fix Boolean/Choice settings not working properly on initial launch See merge request pleroma/pleroma-fe!1389
Diffstat (limited to 'src/components/settings_modal/helpers/boolean_setting.js')
-rw-r--r--src/components/settings_modal/helpers/boolean_setting.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/settings_modal/helpers/boolean_setting.js b/src/components/settings_modal/helpers/boolean_setting.js
index 1dda49f2..5c52f697 100644
--- a/src/components/settings_modal/helpers/boolean_setting.js
+++ b/src/components/settings_modal/helpers/boolean_setting.js
@@ -16,10 +16,18 @@ export default {
return [firstSegment + 'DefaultValue', ...rest].join('.')
},
state () {
- return get(this.$parent, this.path)
+ const value = get(this.$parent, this.path)
+ if (value === undefined) {
+ return this.defaultState
+ } else {
+ return value
+ }
+ },
+ defaultState () {
+ return get(this.$parent, this.pathDefault)
},
isChanged () {
- return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
+ return this.state !== this.defaultState
}
},
methods: {