remove protocolHandler, only apply on bitcoincash: + support legacy&bitpay address types

This commit is contained in:
Sebastiaan Pasma 2018-07-02 10:34:32 +02:00
commit 6b20a01e25
2 changed files with 3 additions and 2 deletions

View file

@ -75,7 +75,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
}
try {
clipboardService.copyToClipboard($scope.protocolHandler + ":" + $scope.addr);
clipboardService.copyToClipboard($scope.wallet.coin == 'bch' && $scope.bchAddressType.type == 'cashaddr' ? 'bitcoincash:' + $scope.addr : $scope.addr);
} catch (error) {
$log.debug("Error copying to clipboard:");
$log.debug(error);

View file

@ -3,9 +3,10 @@
angular.module('copayApp.services').factory('clipboardService', function ($http, $log, platformInfo, nodeWebkitService, gettextCatalog, ionicToast, clipboard) {
var root = {};
root.copyToClipboard = function (data, scope) {
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) {