got address book working with bitcoin cash addresses
This commit is contained in:
parent
1d3da45e32
commit
1c8990fc08
10 changed files with 41 additions and 23 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.directives')
|
||||
.directive('validAddress', ['$rootScope', 'bitcore', 'bitcoreCash',
|
||||
function($rootScope, bitcore, bitcoreCash) {
|
||||
.directive('validAddress', ['$rootScope', 'bitcore', 'bitcoreCash', 'bitcoinCashJsService',
|
||||
function($rootScope, bitcore, bitcoreCash, bitcoinCashJsService) {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, elem, attrs, ctrl) {
|
||||
|
|
@ -15,6 +15,10 @@ angular.module('copayApp.directives')
|
|||
|
||||
var validator = function(value) {
|
||||
|
||||
if (value.indexOf('bitcoincash:') >= 0 || value[0] == 'C' || value[0] == 'H') {
|
||||
value = bitcoinCashJsService.readAddress(value).legacy;
|
||||
}
|
||||
|
||||
// Regular url
|
||||
if (/^https?:\/\//.test(value)) {
|
||||
ctrl.$setValidity('validAddress', true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue