Only copy address to clipboard after click "generate new address"
This commit is contained in:
parent
f4b4aaae27
commit
d801e287fd
2 changed files with 9 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setAddress = function(newAddr) {
|
$scope.setAddress = function(newAddr, copyAddress) {
|
||||||
$scope.addr = null;
|
$scope.addr = null;
|
||||||
if (!$scope.wallet || $scope.generatingAddress || !$scope.wallet.isComplete()) return;
|
if (!$scope.wallet || $scope.generatingAddress || !$scope.wallet.isComplete()) return;
|
||||||
$scope.generatingAddress = true;
|
$scope.generatingAddress = true;
|
||||||
|
|
@ -58,11 +58,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
||||||
paymentSubscriptionObj.addr = $scope.addr
|
paymentSubscriptionObj.addr = $scope.addr
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (copyAddress === true) {
|
||||||
clipboardService.copyToClipboard($scope.wallet.coin == 'bch' && $scope.bchAddressType.type == 'cashaddr' ? 'bitcoincash:' + $scope.addr : $scope.addr);
|
try {
|
||||||
} catch (error) {
|
clipboardService.copyToClipboard($scope.wallet.coin == 'bch' && $scope.bchAddressType.type == 'cashaddr' ? 'bitcoincash:' + $scope.addr : $scope.addr);
|
||||||
$log.debug("Error copying to clipboard:");
|
} catch (error) {
|
||||||
$log.debug(error);
|
$log.debug("Error copying to clipboard:");
|
||||||
|
$log.debug(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// create subscription
|
// create subscription
|
||||||
var msg = JSON.stringify(paymentSubscriptionObj);
|
var msg = JSON.stringify(paymentSubscriptionObj);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button ng-show="addr" class="button-address" ng-click="setAddress(true)">
|
<button ng-show="addr" class="button-address" ng-click="setAddress(true, true)">
|
||||||
<span translate>Generate new address</span>
|
<span translate>Generate new address</span>
|
||||||
</button><br/>
|
</button><br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue