mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-724: Prefer to return an existing group rather than create a new one.
This ensures that focus state is maintained when switching from one group to another. Focus state is otherwise reset when the group is recreated.
This commit is contained in:
@@ -235,6 +235,15 @@ angular.module('client').factory('guacClientManager', ['$injector',
|
||||
*/
|
||||
service.getManagedClientGroup = function getManagedClientGroup(id) {
|
||||
|
||||
var managedClientGroups = storedManagedClientGroups();
|
||||
var existingGroup = _.find(managedClientGroups, (group) => {
|
||||
return id === ManagedClientGroup.getIdentifier(group);
|
||||
});
|
||||
|
||||
// Prefer to return the existing group if it exactly matches
|
||||
if (existingGroup)
|
||||
return existingGroup;
|
||||
|
||||
var clients = [];
|
||||
var clientIds = ManagedClientGroup.getClientIdentifiers(id);
|
||||
|
||||
@@ -253,7 +262,6 @@ angular.module('client').factory('guacClientManager', ['$injector',
|
||||
clients : clients
|
||||
});
|
||||
|
||||
var managedClientGroups = storedManagedClientGroups();
|
||||
managedClientGroups.push(group);
|
||||
return group;
|
||||
|
||||
|
Reference in New Issue
Block a user