fix BooleanSetting and ChoiceSetting not working properly on initial

launch as anon visitor (would show all as changed, empty selects)
This commit is contained in:
Henry Jameson 2021-05-31 14:16:37 +03:00
parent 4e96af0442
commit e95412a03c
2 changed files with 6 additions and 3 deletions

View file

@ -18,8 +18,11 @@ export default {
state () {
return get(this.$parent, this.path)
},
defaultState () {
return get(this.$parent, this.pathDefault)
},
isChanged () {
return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
return this.state !== undefined && this.state !== this.defaultState
}
},
methods: {

View file

@ -17,13 +17,13 @@ export default {
return [firstSegment + 'DefaultValue', ...rest].join('.')
},
state () {
return get(this.$parent, this.path)
return get(this.$parent, this.path) || get(this.$parent, this.pathDefault)
},
defaultState () {
return get(this.$parent, this.pathDefault)
},
isChanged () {
return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
return this.state !== undefined && this.state !== this.defaultState
}
},
methods: {