Skip to content

Commit

Permalink
luci-mod-network: properly reflect config state in sysfs tristates
Browse files Browse the repository at this point in the history
When a boolean sysfs option is forcibly set to `0` or `1` in uci, then make
sure to properly reflect that choice state when rendering the widget.

Right now the dropdown incorrectly reverted to "automatic" after saving but
not applying the changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Dec 8, 2023
1 parent 6bdc577 commit 4b6b009
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ var cbiFlagTristate = form.ListValue.extend({
this.vallist[0] = sysdef ? _('automatic (enabled)') : _('automatic (disabled)');
}

return this.super('renderWidget', [section_id, option_index, cfgvalue]);
return this.super('renderWidget', [section_id, option_index, cfgvalue ? cfgvalue + '!' : null]);
}
});

Expand Down

0 comments on commit 4b6b009

Please sign in to comment.