aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/helpers/boolean_setting.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-05-31 14:22:08 +0300
committerHenry Jameson <me@hjkos.com>2021-05-31 14:23:57 +0300
commit32d1a0e1813e706a298871361123636187cde9bc (patch)
treed1c5378e6455977cb6ef90bb1de24c09dbd3d703 /src/components/settings_modal/helpers/boolean_setting.js
parente95412a03cb84d4d835047d44e55a2900cdfb0d1 (diff)
better approach
Diffstat (limited to 'src/components/settings_modal/helpers/boolean_setting.js')
-rw-r--r--src/components/settings_modal/helpers/boolean_setting.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/settings_modal/helpers/boolean_setting.js b/src/components/settings_modal/helpers/boolean_setting.js
index dea77e10..5c52f697 100644
--- a/src/components/settings_modal/helpers/boolean_setting.js
+++ b/src/components/settings_modal/helpers/boolean_setting.js
@@ -16,13 +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 this.state !== undefined && this.state !== this.defaultState
+ return this.state !== this.defaultState
}
},
methods: {