ref style

This commit is contained in:
JDonadio 2017-09-11 14:50:14 -03:00
commit eba074fd63
No known key found for this signature in database
GPG key ID: EC1F4E04B2BFA730
6 changed files with 85 additions and 50 deletions

View file

@ -5,19 +5,20 @@ angular.module('copayApp.controllers').controller('cashScanController',
var wallet;
var errors = bwcService.getErrors();
$scope.error = null;
$scope.walletDisabled = '#667';
$scope.$on("$ionicView.enter", function(event, data) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
updateAllWallets();
});
var updateAllWallets = function() {
var wallets1 = profileService.getWallets({
var walletsBTC = profileService.getWallets({
coin: 'btc',
onlyComplete: true,
network: 'livenet'
});
if (lodash.isEmpty(wallets1)) {
if (lodash.isEmpty(walletsBTC)) {
$state.go('tabs.home');
return;
}
@ -29,18 +30,19 @@ angular.module('copayApp.controllers').controller('cashScanController',
});
var xPubKeyIndex = lodash.indexBy(walletsBCH, "credentials.xPubKey");
wallets1 = lodash.filter(wallets1, function(w) {
walletsBTC = lodash.filter(walletsBTC, function(w) {
return !xPubKeyIndex[w.credentials.xPubKey];
});
// Filter out non BIP44 wallets
var wallets = lodash.filter(wallets1, function(w) {
var wallets = lodash.filter(walletsBTC, function(w) {
return w.credentials.derivationStrategy == 'BIP44'
});
$scope.wallets = wallets;
$scope.nonBIP44 = wallets1.length != wallets.length;
$scope.nonBIP44Wallets = lodash.filter(walletsBTC, function(w) {
return w.credentials.derivationStrategy != 'BIP44';
});
var i = wallets.length;
var j = 0;
@ -49,23 +51,18 @@ angular.module('copayApp.controllers').controller('cashScanController',
coin: 'bch'
}, function(err, balance) {
if (err) {
wallet.error = (err === 'WALLET_NOT_REGISTERED') ? gettextCatalog.getString('Wallet not registered') : bwcError.msg(err);
$log.error(err);
return;
}
//
wallet.error = null;
wallet.bchBalance = txFormatService.formatAmountStr('bch', balance.availableAmount);
if (++j == i) {
//Done
$timeout(function() {
$rootScope.$apply();
}, 10);
}
});
});
@ -135,7 +132,7 @@ angular.module('copayApp.controllers').controller('cashScanController',
});
};
walletService.getKeys(wallet,function(err,keys) {
walletService.getKeys(wallet, function(err, keys) {
if (err) {
$scope.error = err;
return $timeout(function() {

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesCashController', function($scope, $log, $timeout, appConfigService, lodash, configService, gettextCatalog, externalLinkService) {
angular.module('copayApp.controllers').controller('preferencesCashController', function($scope, $log, $timeout, appConfigService, configService, gettextCatalog, externalLinkService) {
var updateConfig = function() {
var config = configService.getSync();
@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('preferencesCashController', f
};
$scope.$on("$ionicView.enter", function(event, data) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
updateConfig();
});
});

View file

@ -0,0 +1,39 @@
#cash-scan {
.comment {
color: #667;
font-size: 0.9em;
}
.item {
color: $v-dark-gray;
padding-top: 1.3rem;
padding-bottom: 1.3rem;
}
.heading {
font-size: 17px;
color: $v-dark-gray;
margin: 1rem 0;
padding-top: 5px;
padding-bottom: 5px;
border: none;
}
.text-disabled {
color: $v-light-gray;
}
.supported {
display: flex;
.wallet-content {
padding-left: 7px;
}
}
.duplicate-button {
position: absolute;
right: 15px;
padding-top: .5rem;
}
}

View file

@ -50,3 +50,4 @@
@import "includes/pin";
@import "includes/logOptions";
@import "includes/checkBar";
@import "cashScan";