From 0bbf681b2049b74a4e8f4ee71dd5885907da0b80 Mon Sep 17 00:00:00 2001 From: hanwckf Date: Sun, 22 Sep 2024 22:14:01 +0800 Subject: [PATCH] luci-app-mtwifi-cfg: check channel/htmode before uci set --- .../usr/share/luci-app-mtwifi-cfg/wireless-mtk.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js b/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js index 494a61c592..55bc25a2bc 100644 --- a/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js +++ b/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js @@ -579,14 +579,11 @@ var CBIWifiFrequencyValue = form.Value.extend({ }, write: function(section_id, value) { - uci.set('wireless', section_id, 'htmode', value[0] || null); - - if (this.useBandOption) - uci.set('wireless', section_id, 'band', value[1]); - else - uci.set('wireless', section_id, 'hwmode', (value[1] == '2g') ? '11g' : '11a'); - - uci.set('wireless', section_id, 'channel', value[2]); + if (value[0] && value[1] && value[2]) + { + uci.set('wireless', section_id, 'htmode', value[0]); + uci.set('wireless', section_id, 'channel', value[2]); + } } });