summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-02-05 19:35:00 +0100
committerJo-Philipp Wich <jo@mein.io>2023-02-05 19:37:28 +0100
commitc13ef9406c9c2e12c28d2065b342444af5e27c0b (patch)
tree27ea802de6454c8c3c6ffd9b441304a11b7c5e97 /modules/luci-mod-network/htdocs
parent4c304ce332c7d3f1790bcdcfe317af6482b4a99b (diff)
luci-mod-network: interfaces.js: avoid stray empty device uci sections
Ensure that just created uci device sections are removed if the edit option modal is cancelled without saving. This prevents empty, but harmless `config device` sections from being created on a subsequent Save & Apply operation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
index d44b0cf6d0..d0ffe02ee9 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
@@ -1347,6 +1347,9 @@ return view.extend({
for (var i = 0; i < map.addedVLANs.length; i++)
uci.remove('network', map.addedVLANs[i]);
+ if (this.addedSection)
+ uci.remove('network', this.addedSection);
+
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
};