From c13ef9406c9c2e12c28d2065b342444af5e27c0b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 5 Feb 2023 19:35:00 +0100 Subject: 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 --- .../htdocs/luci-static/resources/view/network/interfaces.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/luci-mod-network/htdocs') 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); }; -- cgit v1.2.3