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:
1 parent
c87bd6bb3e
commit
fe44b55f10
1 file changed
+1
-5
@@ -597,17 +597,13 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
|
||||
* set. This promise is always resolved.
|
||||
*/
|
||||
service.setClipboard = function setClipboard(data) {
|
||||
return setLocalClipboard(data).finally(() => {
|
||||
return setLocalClipboard(data)['catch'](angular.noop).finally(() => {
|
||||
|
||||
// Update internal clipboard and broadcast event notifying of
|
||||
// updated contents
|
||||
storedClipboardData(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