diff --git a/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js b/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js index 5824eb194..199b7ddfa 100644 --- a/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js +++ b/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js @@ -58,6 +58,20 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe } }; + /** + * An action which closes the current dialog, and refreshes + * the user data on dialog close. + */ + const ACKNOWLEDGE_ACTION_RELOAD = { + name : 'SETTINGS_PREFERENCES.ACTION_ACKNOWLEDGE', + // Handle action + callback : function acknowledgeCallback() { + userService.getUser(dataSource, username) + .then(user => $scope.user = user) + .then(guacNotification.showStatus(false)) + } + }; + /** * The user being modified. * @@ -237,7 +251,9 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe text : { key : 'SETTINGS_PREFERENCES.INFO_PREFERENCE_ATTRIBUTES_CHANGED' }, - actions : [ ACKNOWLEDGE_ACTION ] + + // Reload the user on successful save in case any attributes changed + actions : [ ACKNOWLEDGE_ACTION_RELOAD ] }), guacNotification.SHOW_REQUEST_ERROR); };