mirror of https://github.com/BTCPrivate/copay.git
paypro: allow payment protocol addresses in address input.
This commit is contained in:
parent
4d244a03f8
commit
ad64ad1e0e
|
@ -12,6 +12,11 @@ angular.module('copayApp.directives')
|
|||
require: 'ngModel',
|
||||
link: function(scope, elem, attrs, ctrl) {
|
||||
var validator = function(value) {
|
||||
// Is payment protocol address?
|
||||
if (value.indexOf('bitcoin:') === 0 && /r=/.test(value)) {
|
||||
ctrl.$setValidity('validAddress', true);
|
||||
return value;
|
||||
}
|
||||
var a = new Address(value);
|
||||
ctrl.$setValidity('validAddress', a.isValid() && a.network().name === config.networkName);
|
||||
return value;
|
||||
|
|
Loading…
Reference in New Issue