Fix tab-send to send BCH or BTC from address book entry
This commit is contained in:
parent
c9253c44f3
commit
31029bc17a
1 changed files with 10 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService) {
|
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, bitcoreCash) {
|
||||||
|
|
||||||
var originalList;
|
var originalList;
|
||||||
var CONTACTS_SHOW_LIMIT;
|
var CONTACTS_SHOW_LIMIT;
|
||||||
|
|
@ -86,6 +86,14 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var getCoin = function(address) {
|
||||||
|
var cashAddress = bitcoreCash.Address.isValid(address, 'livenet');
|
||||||
|
if (cashAddress) {
|
||||||
|
return 'bch';
|
||||||
|
}
|
||||||
|
return 'btc';
|
||||||
|
};
|
||||||
|
|
||||||
var updateContactsList = function(cb) {
|
var updateContactsList = function(cb) {
|
||||||
addressbookService.list(function(err, ab) {
|
addressbookService.list(function(err, ab) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
|
|
@ -100,6 +108,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
address: k,
|
address: k,
|
||||||
email: lodash.isObject(v) ? v.email : null,
|
email: lodash.isObject(v) ? v.email : null,
|
||||||
recipientType: 'contact',
|
recipientType: 'contact',
|
||||||
|
coin: getCoin(k),
|
||||||
getAddress: function(cb) {
|
getAddress: function(cb) {
|
||||||
return cb(null, k);
|
return cb(null, k);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue