remove duplicated addresses information

This commit is contained in:
Javier 2016-11-18 11:24:39 -03:00
commit 439300743d
2 changed files with 4 additions and 58 deletions

View file

@ -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);
});
});
});

View file

@ -80,38 +80,11 @@
<div class="item" ng-repeat="pk in pubKeys" copy-to-clipboard="pk">
<span translate>Copayer {{$index}}</span>
<span class="item-note">
<span>Copayer {{$index}}</span>
<span>{{pk}}</span>
<span ng-if="$index == 0">({{basePath}})</span>
</span>
</div>
<div ng-show="addrs">
<div class="item item-divider" translate>
Latest Wallet Addresses
</div>
<div class="settings-explanation">
<div class="settings-description" translate>
Only &ldquo;main&rdquo; addresses are shown below. This excludes &ldquo;change&rdquo; address.
</div>
</div>
<div class="item" ng-repeat="a in addrs" class="oh" copy-to-clipboard="a.address">
<span>{{a.address}}</span>
<span class="item-note">{{a.path}} &middot; {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }}</span>
</div>
<div class="settings-explanation">
<div class="settings-description" translate>
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.
</div>
</div>
<button class="button button-standard button-primary" ng-click="scan()" translate>
Scan addresses for funds
</button>
<button class="button button-standard button-primary" ng-show="isCordova" ng-click="sendAddrs()" translate>
Send addresses by email
</button>
</div>
<div ng-show="wallet.balanceByAddress[0]">
<div class="item item-divider" translate>
Balance By Address