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>
This commit is contained in:
parent
4c304ce332
commit
c13ef9406c
1 changed files with 3 additions and 0 deletions
|
@ -1347,6 +1347,9 @@ return view.extend({
|
||||||
for (var i = 0; i < map.addedVLANs.length; i++)
|
for (var i = 0; i < map.addedVLANs.length; i++)
|
||||||
uci.remove('network', map.addedVLANs[i]);
|
uci.remove('network', map.addedVLANs[i]);
|
||||||
|
|
||||||
|
if (this.addedSection)
|
||||||
|
uci.remove('network', this.addedSection);
|
||||||
|
|
||||||
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
|
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue