diff options
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js | 12 |
1 files changed, 6 insertions, 6 deletions
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 9e75fe901..d0287fe1a 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 @@ -1769,14 +1769,14 @@ return L.view.extend({ uci.set('wireless', section_id, 'key1', passval); } - var zonePromise = zoneval - ? firewall.getZone(zoneval).then(function(zone) { return zone || firewall.addZone(zoneval) }) - : Promise.resolve(); + return network.addNetwork(nameval, { proto: 'dhcp' }).then(function(net) { + firewall.deleteNetwork(net.getName()); - return zonePromise.then(function(zone) { - return network.addNetwork(nameval, { proto: 'dhcp' }).then(function(net) { - firewall.deleteNetwork(net.getName()); + var zonePromise = zoneval + ? firewall.getZone(zoneval).then(function(zone) { return zone || firewall.addZone(zoneval) }) + : Promise.resolve(); + return zonePromise.then(function(zone) { if (zone) zone.addNetwork(net.getName()); }); |