luci-app-firewall: fix removing networks from zone
authorJo-Philipp Wich <jo@mein.io>
Fri, 20 Nov 2020 12:28:28 +0000 (13:28 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 20 Nov 2020 12:29:50 +0000 (13:29 +0100)
Fixes: #4608
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4dbf600de61c0db9052343f0447ee31db79a8346)

applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js

index b24521e1eede311c2f96f2f66e2cc82e8f972f2a..b2f9b81a9ba17811b726e7eb363f1be029793c31 100644 (file)
@@ -186,9 +186,11 @@ return view.extend({
                                }
 
                        return Promise.all(tasks).then(function(zone_networks) {
-                               if (zone_networks[0])
+                               if (zone_networks[0]) {
+                                       zone_networks[0].clearNetworks();
                                        for (var i = 1; i < zone_networks.length; i++)
                                                zone_networks[0].addNetwork(zone_networks[i].getName());
+                               }
                        });
                };