From: Paul Donald Date: Tue, 1 Apr 2025 12:28:03 +0000 (+0200) Subject: luci-mod-network: fix handleAdd in wireless.js X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=f5a61be8547e813ed49b7504cd841cba53a6d4d1;p=project%2Fluci.git luci-mod-network: fix handleAdd in wireless.js handleAdd did not work correctly for a while: some state was not cleaned up (try: wireless -> add -> no changes -> click dismiss -> press save). The state is now properly removed when pressing dismiss, by stashing addedSection correctly under the map m and not in this. Also requires a null check in render_modal_status. Signed-off-by: Paul Donald (cherry picked from commit 6c061b644c1380b841542f44179195756cc5a645) --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index b9d5551799..ed077aeeb9 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -152,6 +152,8 @@ function render_network_status(radioNet) { } function render_modal_status(node, radioNet) { + if (!radioNet) return; + const mode = radioNet.getActiveMode(); const noise = radioNet.getNoise(); const bssid = radioNet.getActiveBSSID(); @@ -2299,7 +2301,7 @@ return view.extend({ uci.set('wireless', section_id, 'ssid', 'OpenWrt'); uci.set('wireless', section_id, 'encryption', 'none'); - this.addedSection = section_id; + m.addedSection = section_id; return this.renderMoreOptionsModal(section_id); };