luci-app-mtwifi-cfg: check channel/htmode before uci set

This commit is contained in:
hanwckf 2024-09-22 22:14:01 +08:00
parent 1b99cd51c5
commit 0bbf681b20

View File

@ -579,14 +579,11 @@ var CBIWifiFrequencyValue = form.Value.extend({
}, },
write: function(section_id, value) { write: function(section_id, value) {
uci.set('wireless', section_id, 'htmode', value[0] || null); if (value[0] && value[1] && value[2])
{
if (this.useBandOption) uci.set('wireless', section_id, 'htmode', value[0]);
uci.set('wireless', section_id, 'band', value[1]); uci.set('wireless', section_id, 'channel', value[2]);
else }
uci.set('wireless', section_id, 'hwmode', (value[1] == '2g') ? '11g' : '11a');
uci.set('wireless', section_id, 'channel', value[2]);
} }
}); });