From 2f92a296281ae922472d1acf5e759878567c6ee9 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Tue, 24 Sep 2019 01:11:16 +0800 Subject: luci-mod-network: resort zonePromise order This fix #3103 Signed-off-by: Chen Minqiang --- .../htdocs/luci-static/resources/view/network/wireless.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules') 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 9e75fe9013..d0287fe1af 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()); }); -- cgit v1.2.3