mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-724: Always resolve promise from setClipboard() (as documented).
Returning a value from the callback provided to finally() is not sufficient to force promise resolution.
This commit is contained in:
@@ -597,17 +597,13 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
|
|||||||
* set. This promise is always resolved.
|
* set. This promise is always resolved.
|
||||||
*/
|
*/
|
||||||
service.setClipboard = function setClipboard(data) {
|
service.setClipboard = function setClipboard(data) {
|
||||||
return setLocalClipboard(data).finally(() => {
|
return setLocalClipboard(data)['catch'](angular.noop).finally(() => {
|
||||||
|
|
||||||
// Update internal clipboard and broadcast event notifying of
|
// Update internal clipboard and broadcast event notifying of
|
||||||
// updated contents
|
// updated contents
|
||||||
storedClipboardData(data);
|
storedClipboardData(data);
|
||||||
$rootScope.$broadcast('guacClipboard', data);
|
$rootScope.$broadcast('guacClipboard', data);
|
||||||
|
|
||||||
// Ensure promise is resolved (this function may be called from
|
|
||||||
// the promise rejection handler)
|
|
||||||
return data;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user