From c3e5c5dffc495d20ce978aa0ad2f9dcfe3dd894a Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 2 Sep 2020 14:40:31 -0700 Subject: [PATCH] Fixed repeating group action menu items bug. --- views/default.handlebars | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/views/default.handlebars b/views/default.handlebars index 204c2032..41e37827 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -4366,7 +4366,7 @@ } function groupActionFunction() { - var addedOptions = '', nodeids = getCheckedDevices(); + var addedOptions = '', nodeids = getCheckedDevices(), added = 0; // Check if any of the selected devices have a MQTT connection active if (features & 0x00400000) { @@ -4375,9 +4375,9 @@ // Display the "Uninstall Agent" option if allowed and we selected connected devices. for (var i in nodeids) { - var node = getNodeFromId(nodeids[i]), rights = GetNodeRights(node), added = 0; - if ((rights & 1) && ((added & 2) == 0)) { added += 2; addedOptions += ''; } - if (((node.conn & 1) != 0) && ((rights & 0x8000) != 0) && ((added & 1) == 0)) { added += 1; addedOptions += ''; } + var node = getNodeFromId(nodeids[i]), rights = GetNodeRights(node); + if ((rights & 1) && ((added & 2) == 0)) { added |= 2; addedOptions += ''; } + if (((node.conn & 1) != 0) && ((rights & 0x8000) != 0) && ((added & 1) == 0)) { added |= 1; addedOptions += ''; } } var x = "Select an operation to perform on all selected devices. Actions will be performed only with proper rights." + '

';