Merge branch 'wallet/task/420' into wallet/task/416

This commit is contained in:
Sebastiaan Pasma 2018-07-10 10:27:44 +02:00
commit 9a9ddbc413
16 changed files with 910 additions and 17 deletions

View file

@ -17,7 +17,27 @@ angular.module('copayApp.services').factory('clipboardService', function ($http,
// No 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(text => {
cb(text);
})
.catch(err => {
$log.debug("Clipboard reading is not supported in browser..");
});
return;
}
};
return root;