Split wallets by type (bitcoin and bitcoin cash)

This commit is contained in:
Gustavo Maximiliano Cortez 2017-10-05 15:18:30 -03:00
commit a853c17a0d
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
7 changed files with 76 additions and 41 deletions

View file

@ -28,7 +28,7 @@ angular.module('copayApp.controllers').controller('createController',
$scope.formData.bwsurl = defaults.bws.url;
$scope.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);
$scope.formData.derivationPath = derivationPathHelper.default;
$scope.formData.coin = 'btc';
$scope.formData.coin = data.stateParams.coin;
if (config.cashSupport) $scope.enableCash = true;

View file

@ -16,7 +16,7 @@ angular.module('copayApp.controllers').controller('importController',
$scope.formData.bwsurl = defaults.bws.url;
$scope.formData.derivationPath = derivationPathHelper.default;
$scope.formData.account = 1;
$scope.formData.coin = 'btc';
$scope.formData.coin = $stateParams.coin;
$scope.importErr = false;
$scope.isCopay = appConfigService.name == 'copay';
$scope.fromHardwareWallet = {

View file

@ -11,7 +11,7 @@ angular.module('copayApp.controllers').controller('joinController',
$scope.formData.derivationPath = derivationPathHelper.default;
$scope.formData.account = 1;
$scope.formData.secret = null;
$scope.formData.coin = 'btc';
$scope.formData.coin = data.stateParams.coin;
if (config.cashSupport) $scope.enableCash = true;
resetPasswordFields();
updateSeedSourceSelect();

View file

@ -206,14 +206,24 @@ angular.module('copayApp.controllers').controller('tabHomeController',
};
var updateAllWallets = function() {
$scope.wallets = profileService.getWallets();
if (lodash.isEmpty($scope.wallets)) return;
var wallets = [];
$scope.walletsBtc = profileService.getWallets({coin: 'btc'});
$scope.walletsBch = profileService.getWallets({coin: 'bch'});
var i = $scope.wallets.length;
lodash.each($scope.walletsBtc, function(wBtc) {
wallets.push(wBtc);
});
lodash.each($scope.walletsBch, function(wBch) {
wallets.push(wBch);
});
if (lodash.isEmpty(wallets)) return;
var i = wallets.length;
var j = 0;
var timeSpan = 60 * 60 * 24 * 7;
lodash.each($scope.wallets, function(wallet) {
lodash.each(wallets, function(wallet) {
walletService.getStatus(wallet, {}, function(err, status) {
if (err) {