Merge branch 'wallet/sprint/20' into wallet/task/426

This commit is contained in:
Sebastiaan Pasma 2018-07-17 13:41:09 +02:00
commit 6463d5df34
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
43 changed files with 789 additions and 999 deletions

View file

@ -22,7 +22,27 @@ angular.module('copayApp.services').factory('clipboardService', function ($http,
// Not supported
return;
}
};
root.readFromClipboard = function (cb) {
$log.debug("Read from clipboard");
if (platformInfo.isCordova) {
cordova.plugins.clipboard.paste(function(text) {
cb(text);
})
} else if (platformInfo.isNW) {
cb(nodeWebkitService.readFromClipboard());
} else {
navigator.clipboard.readText()
.then(function (text) {
cb(text);
})
.catch(function (err) {
$log.debug("Clipboard reading is not supported in browser..");
});
return;
}
};
return root;