Fix setting groups visibility

Change I60c50a6c4 introduced a broken way of setting the visibility.

This commit fixes it as setting false in a string equals true in
javascript.

The check was also unneeded as it will be false by default (if not set).

Bug: Issue 10587
Change-Id: Ife40780f162d4eb5e3f75f4a6ed65f01aa7dc0e4
(cherry picked from commit b7b5cf0067)
This commit is contained in:
Paladox none 2019-03-11 19:04:21 +00:00
parent 8e1da30f78
commit a4b8fa769a
1 changed files with 4 additions and 7 deletions

View File

@ -162,13 +162,10 @@
},
_handleSaveOptions() {
let options;
// The value is in string so we have to convert it to a boolean.
if (this._groupConfig.options.visible_to_all) {
options = {visible_to_all: true};
} else if (!this._groupConfig.options.visible_to_all) {
options = {visible_to_all: false};
}
const visible = this._groupConfig.options.visible_to_all;
const options = {visible_to_all: visible};
return this.$.restAPI.saveGroupOptions(this.groupId,
options).then(config => {
this._options = false;