diff --git a/src/js/controllers/cashScan.js b/src/js/controllers/cashScan.js index 4bc429e07..7f60192e3 100644 --- a/src/js/controllers/cashScan.js +++ b/src/js/controllers/cashScan.js @@ -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() { diff --git a/src/js/controllers/preferencesCash.js b/src/js/controllers/preferencesCash.js index e720d7735..eb81e0394 100644 --- a/src/js/controllers/preferencesCash.js +++ b/src/js/controllers/preferencesCash.js @@ -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(); }); }); diff --git a/src/sass/views/cashScan.scss b/src/sass/views/cashScan.scss new file mode 100644 index 000000000..5ae76ef53 --- /dev/null +++ b/src/sass/views/cashScan.scss @@ -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; + } +} diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 722c97e1d..37754970f 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -50,3 +50,4 @@ @import "includes/pin"; @import "includes/logOptions"; @import "includes/checkBar"; +@import "cashScan"; diff --git a/www/views/cashScan.html b/www/views/cashScan.html index 40621ee2b..2e62297ba 100644 --- a/www/views/cashScan.html +++ b/www/views/cashScan.html @@ -1,4 +1,4 @@ - + Bitcoin Cash (BCH) Balances @@ -10,51 +10,49 @@
-
+
+ No wallets eligible for Bitcoin Cash support +
+ +
+ {{error}} +
+ +
BTC Wallets
+
+ + + +
+
{{wallet.name || wallet.id}}
+
{{wallet.bchBalance || ('Checking...' | translate)}}
+
{{wallet.m}}-of-{{wallet.n}}
+
-
- No wallets elegible for Bitcoin Cash support +
+ +
+
+
+
+ Non eligible BTC wallets +
-
- {{error}} -
- -
- Some of you wallets are not elegible for Bitcon Cash support because there where created before Copay v1.2. Please use our recovery tool to access your Bitcoin Cash balance for those wallets -
- -
- -
+
- + - - {{wallet.name || wallet.id}} - -

+ {{wallet.name || wallet.id}} +

- {{wallet.bchBalance || 'Checking...'}} - - {{wallet.m}}-of-{{wallet.n}} - -   -

- - -
- -
+
+ Some of you wallets are not eligible for Bitcon Cash support because there where created before Copay v1.2. Please use our recovery tool to access your Bitcoin Cash balance for those wallets
diff --git a/www/views/preferencesCash.html b/www/views/preferencesCash.html index bc18563aa..b03acec3c 100644 --- a/www/views/preferencesCash.html +++ b/www/views/preferencesCash.html @@ -15,7 +15,7 @@
Enable Bitcoin Cash wallet creation and operation within the App. - Learn more + Learn more