luci-base: fix widgets CBIUserSelect appending list on load 4286/head
authorHelge Mader <ma@dev.tdt.de>
Fri, 24 Jul 2020 08:27:07 +0000 (10:27 +0200)
committerHelge Mader <ma@dev.tdt.de>
Fri, 24 Jul 2020 09:03:40 +0000 (11:03 +0200)
The user list was appended to the dropdown again each time the page is loaded.

Signed-off-by: Helge Mader <ma@dev.tdt.de>
modules/luci-base/htdocs/luci-static/resources/tools/widgets.js

index 7f724a17e42c851aed57fa180762d1744f8ff9d9..1de8a08bc3b5ecc160684cac2652c37038173f9e 100644 (file)
@@ -580,6 +580,8 @@ var CBIUserSelect = form.ListValue.extend({
 
        load: function(section_id) {
                return getUsers().then(L.bind(function(users) {
+                       delete this.keylist;
+                       delete this.vallist;
                        for (var i = 0; i < users.length; i++) {
                                this.value(users[i]);
                        }