diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 0d5902b0c..1299c02c1 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -792,7 +792,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (!txs || !txs[0]) return; var cacheUnit = txs[0].amountStr.split(' ')[1]; - console.log('[index.js.794:cacheUnit:]', cacheUnit, config.unitName); //TODO if (cacheUnit == config.unitName) return; diff --git a/src/js/controllers/sidebar.js b/src/js/controllers/sidebar.js index 86157cecc..7cf3d57a9 100644 --- a/src/js/controllers/sidebar.js +++ b/src/js/controllers/sidebar.js @@ -28,8 +28,7 @@ angular.module('copayApp.controllers').controller('sidebarController', self.switchWallet = function(selectedWalletId, currentWalletId) { if (selectedWalletId == currentWalletId) return; self.walletSelection = false; - profileService.setAndStoreFocus(selectedWalletId, function() { - }); + profileService.setAndStoreFocus(selectedWalletId, function() {}); }; self.toggleWalletSelection = function() { @@ -40,10 +39,14 @@ angular.module('copayApp.controllers').controller('sidebarController', self.setWallets = function() { if (!profileService.profile) return; + var config = configService.getSync(); config.colorFor = config.colorFor || {}; config.aliasFor = config.aliasFor || {}; - var ret = lodash.map(profileService.profile.credentials, function(c) { + + // Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes) + var credentials = lodash.filter(profileService.profile.credentials, 'walletName'); + var ret = lodash.map(credentials, function(c) { return { m: c.m, n: c.n, @@ -52,6 +55,7 @@ angular.module('copayApp.controllers').controller('sidebarController', color: config.colorFor[c.walletId] || '#4A90E2', }; }); + self.wallets = lodash.sortBy(ret, 'name'); };