GUACAMOLE-1656: Ensure the preferences page refreshes on save in case a one-time-token was updated.

This commit is contained in:
James Muehlner
2022-08-05 15:56:09 +00:00
parent 33f2b499ef
commit e882a08486

View File

@@ -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);
};