Merge pull request #198 from Bitcoin-com/wallet/task/409
Bug - 409 - "Generate new address" copies "bitcoincash:null" to the clipboard instead of a new address
This commit is contained in:
commit
d6222623e1
4 changed files with 41 additions and 23 deletions
24
src/js/services/clipboardService.js
Normal file
24
src/js/services/clipboardService.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('clipboardService', function ($http, $log, platformInfo, nodeWebkitService, gettextCatalog, ionicToast, clipboard) {
|
||||
var root = {};
|
||||
|
||||
root.copyToClipboard = function (data) {
|
||||
if (!data) return;
|
||||
|
||||
$log.debug("Copy '"+data+"' to clipboard");
|
||||
if (platformInfo.isCordova) {
|
||||
cordova.plugins.clipboard.copy(data);
|
||||
} else if (platformInfo.isNW) {
|
||||
nodeWebkitService.writeToClipboard(data);
|
||||
} else if (clipboard.supported) {
|
||||
clipboard.copyText(data);
|
||||
} else {
|
||||
// No supported
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return root;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue