From 6b8b57ef5a7ddbc3c6e63c94a294214c04b8386d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 4 Jul 2021 19:16:18 -0700 Subject: [PATCH] GUACAMOLE-724: Ensure connection parameters are updated when likely to be available (not just when group is attached). --- .../client/controllers/clientController.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js index 2221029b5..f76621bc7 100644 --- a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js +++ b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js @@ -451,9 +451,15 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Update client state/behavior as visibility of the Guacamole menu changes $scope.$watch('menu.shown', function menuVisibilityChanged(menuShown, menuShownPreviousState) { - + + // Update available connection parameters, if there is a focused + // client + if (menuShown) + $scope.menu.connectionParameters = $scope.focusedClient ? + ManagedClient.getArgumentModel($scope.focusedClient) : {}; + // Send any argument value data once menu is hidden - if (!menuShown && menuShownPreviousState) + else if (menuShownPreviousState) $scope.applyParameterChanges($scope.focusedClient); }); @@ -464,15 +470,14 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams var oldFocusedClient = $scope.focusedClient; $scope.focusedClient = newFocusedClient; + // Ignore if focus is not actually changing + if (oldFocusedClient === newFocusedClient) + return; + // Apply any parameter changes when focus is changing if (oldFocusedClient) $scope.applyParameterChanges(oldFocusedClient); - // Update available connection parameters, if there is a focused - // client - $scope.menu.connectionParameters = newFocusedClient ? - ManagedClient.getArgumentModel(newFocusedClient) : {}; - }); // Update page icon when thumbnail changes