From 439300743d4be8abed877e35312eb0e4e2e0140b Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 18 Nov 2016 11:24:39 -0300 Subject: [PATCH] remove duplicated addresses information --- src/js/controllers/preferencesInformation.js | 35 +++----------------- www/views/preferencesInformation.html | 27 --------------- 2 files changed, 4 insertions(+), 58 deletions(-) diff --git a/src/js/controllers/preferencesInformation.js b/src/js/controllers/preferencesInformation.js index 2f2da8b00..ac649c56b 100644 --- a/src/js/controllers/preferencesInformation.js +++ b/src/js/controllers/preferencesInformation.js @@ -1,11 +1,10 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesInformation', - function($scope, $log, $timeout, $ionicHistory, $ionicScrollDelegate, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) { + function($scope, $log, $timeout, $ionicHistory, platformInfo, lodash, profileService, configService, $stateParams, walletService, $state) { var base = 'xpub'; var wallet = profileService.getWallet($stateParams.walletId); var walletId = wallet.id; - var config = configService.getSync(); var b = 1; $scope.isCordova = platformInfo.isCordova; @@ -25,9 +24,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation', }; $timeout(function() { - wallet.getMainAddresses({ - doNotVerify: true - }, function(err, addrs) { + walletService.getMainAddresses(wallet, {}, function(err, addrs) { if (err) { $log.warn(err); return; @@ -52,9 +49,9 @@ angular.module('copayApp.controllers').controller('preferencesInformation', $timeout(function() { $scope.$apply(); - }, 1000); + }); }); - }, 100); + }); }; $scope.saveBlack = function() { @@ -95,29 +92,5 @@ angular.module('copayApp.controllers').controller('preferencesInformation', $scope.M = c.m; $scope.N = c.n; $scope.pubKeys = lodash.pluck(c.publicKeyRing, 'xPubKey'); - $scope.addrs = null; - - wallet.getMainAddresses({ - doNotVerify: true - }, function(err, addrs) { - if (err) { - $log.warn(err); - return; - }; - var last10 = [], - i = 0, - e = addrs.pop(); - while (i++ < 10 && e) { - e.path = base + e.path.substring(1); - last10.push(e); - e = addrs.pop(); - } - $scope.addrs = last10; - $timeout(function() { - $ionicScrollDelegate.resize(); - $scope.$apply(); - }, 10); - }); }); - }); diff --git a/www/views/preferencesInformation.html b/www/views/preferencesInformation.html index 5871585c5..5795790a2 100644 --- a/www/views/preferencesInformation.html +++ b/www/views/preferencesInformation.html @@ -80,38 +80,11 @@
Copayer {{$index}} - Copayer {{$index}} {{pk}} ({{basePath}})
-
-
- Latest Wallet Addresses -
-
-
- Only “main” addresses are shown below. This excludes “change” address. -
-
-
- {{a.address}} - {{a.path}} · {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }} -
-
-
- Please note: due to resource constraints, this list of addresses is not verified locally. A compromised BWS node could return addresses which are not controlled by this wallet. -
-
- - -
-
Balance By Address