summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChen Minqiang <ptpt52@gmail.com>2019-09-24 01:11:16 +0800
committerJo-Philipp Wich <jo@mein.io>2019-09-24 07:08:49 +0200
commit2f92a296281ae922472d1acf5e759878567c6ee9 (patch)
treec32e60209a91bd44fa01a7ac5646172d99084ace
parentf3ff641d8e4e5127db7fc7738187edb4aa88d18b (diff)
luci-mod-network: resort zonePromise order
This fix #3103 Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js12
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 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());
});