diff --git a/src/js/controllers/cashScan.js b/src/js/controllers/cashScan.js index f00ed3ebf78..85fddf2399e 100644 --- a/src/js/controllers/cashScan.js +++ b/src/js/controllers/cashScan.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('cashScanController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $ionicHistory, $window, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, txFormatService, bwcError, pushNotificationsService, bwcService) { + function($rootScope, $timeout, $scope, $state, $ionicHistory, gettextCatalog, lodash, ongoingProcess, profileService, walletService, $log, txFormatService, bwcError, pushNotificationsService, bwcService, externalLinkService) { var wallet; var errors = bwcService.getErrors(); $scope.error = null; @@ -11,6 +11,16 @@ angular.module('copayApp.controllers').controller('cashScanController', updateAllWallets(); }); + $scope.openRecoveryToolLink = function() { + var url = 'https://bitpay.github.io/copay-recovery/'; + var optIn = true; + var title = null; + var message = gettextCatalog.getString('Open the recovery tool.'); + var okText = gettextCatalog.getString('Open'); + var cancelText = gettextCatalog.getString('Go Back'); + externalLinkService.open(url, optIn, title, message, okText, cancelText); + }; + var goHome = function() { $ionicHistory.nextViewOptions({ disableAnimate: true, @@ -29,11 +39,6 @@ angular.module('copayApp.controllers').controller('cashScanController', network: 'livenet' }); - if (lodash.isEmpty(walletsBTC)) { - goHome(); - return; - } - // Filter out already duplicated wallets var walletsBCH = profileService.getWallets({ coin: 'bch', @@ -45,19 +50,30 @@ angular.module('copayApp.controllers').controller('cashScanController', return !xPubKeyIndex[w.credentials.xPubKey]; }); - // Filter out non BIP44 wallets - var wallets = lodash.filter(walletsBTC, function(w) { - return w.credentials.derivationStrategy == 'BIP44' + var availableWallets = []; + var nonEligibleWallets = []; + + lodash.each(walletsBTC, function(w) { + if (w.credentials.derivationStrategy != 'BIP44') { + w.excludeReason = gettextCatalog.getString('Non BIP44 wallet'); + nonEligibleWallets.push(w); + } else if (!w.canSign()) { + w.excludeReason = gettextCatalog.getString('Read only wallet'); + nonEligibleWallets.push(w); + } else if (w.needsBackup) { + w.excludeReason = gettextCatalog.getString('Backup needed'); + nonEligibleWallets.push(w); + } else { + availableWallets.push(w); + } }); - $scope.wallets = wallets; - $scope.nonBIP44Wallets = lodash.filter(walletsBTC, function(w) { - return w.credentials.derivationStrategy != 'BIP44'; - }); + $scope.availableWallets = availableWallets; + $scope.nonEligibleWallets = nonEligibleWallets; - var i = wallets.length; + var i = availableWallets.length; var j = 0; - lodash.each(wallets, function(wallet) { + lodash.each(availableWallets, function(wallet) { walletService.getBalance(wallet, { coin: 'bch' }, function(err, balance) { diff --git a/src/sass/views/cashScan.scss b/src/sass/views/cashScan.scss index 5ae76ef5346..f13e1b390be 100644 --- a/src/sass/views/cashScan.scss +++ b/src/sass/views/cashScan.scss @@ -36,4 +36,8 @@ right: 15px; padding-top: .5rem; } + + a { + cursor: pointer; + } } diff --git a/src/sass/views/wallet-backup-phrase.scss b/src/sass/views/wallet-backup-phrase.scss index de3879b0d05..c012b09f223 100644 --- a/src/sass/views/wallet-backup-phrase.scss +++ b/src/sass/views/wallet-backup-phrase.scss @@ -1,4 +1,22 @@ #wallet-backup-phrase { + .comment { + color: #667; + font-size: 0.9em; + } + .item { + color: $v-dark-gray; + padding-top: 1.3rem; + padding-bottom: 1.3rem; + border: none; + } + .heading { + font-size: 17px; + color: $v-dark-gray; + margin: 1rem 0; + padding-top: 5px; + padding-bottom: 5px; + border: none; + } h3 { padding: 15px; } diff --git a/www/views/backup.html b/www/views/backup.html index cfaee090228..c636bf06093 100644 --- a/www/views/backup.html +++ b/www/views/backup.html @@ -7,9 +7,16 @@ -
-
Wallet recovery phrase not available.
-
You can still export it from Advanced > Export.
+
+
+ Wallet recovery phrase not available +
+
+ You can still export it from Advanced > Export. +
+
+
+ Note: if this BCH wallet was duplicated from a BTC wallet, they share the same recovery phrase.