Adds bitcoincash URL support
This commit is contained in:
parent
2e4c1d6abd
commit
823814817d
8 changed files with 45 additions and 26 deletions
|
|
@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
|
|||
$timeout(function() {
|
||||
var form = addressbookForm;
|
||||
if (data && form) {
|
||||
data = data.replace('bitcoin:', '');
|
||||
data = data.replace(/^bitcoin[cash]*:/, '');
|
||||
form.address.$setViewValue(data);
|
||||
form.address.$isValid = true;
|
||||
form.address.$render();
|
||||
|
|
|
|||
|
|
@ -63,12 +63,16 @@ angular.module('copayApp.controllers').controller('customAmountController', func
|
|||
|
||||
$scope.shareAddress = function() {
|
||||
if (!platformInfo.isCordova) return;
|
||||
var data = 'bitcoin:' + $scope.address + '?amount=' + $scope.amountBtc + '&coin=' + $scope.wallet.coin;
|
||||
var protocol = 'bitcoin';
|
||||
if ($scope.wallet.coin == 'bch') protocol += 'cash';
|
||||
var data = protocol + ':' + $scope.address + '?amount=' + $scope.amountBtc;
|
||||
window.plugins.socialsharing.share(data, null, null, null);
|
||||
}
|
||||
|
||||
$scope.copyToClipboard = function() {
|
||||
return 'bitcoin:' + $scope.address + '?amount=' + $scope.amountBtc + '&coin=' + $scope.wallet.coin;
|
||||
var protocol = 'bitcoin';
|
||||
if ($scope.wallet.coin == 'bch') protocol += 'cash';
|
||||
return protocol + ':' + $scope.address + '?amount=' + $scope.amountBtc;
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
|||
|
||||
$scope.shareAddress = function() {
|
||||
if (!$scope.isCordova) return;
|
||||
window.plugins.socialsharing.share('bitcoin:' + $scope.addr, null, null, null);
|
||||
var protocol = 'bitcoin';
|
||||
if ($scope.wallet.coin == 'bch') protocol += 'cash';
|
||||
window.plugins.socialsharing.share(protocol + ':' + $scope.addr, null, null, null);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue