Fix loading wallet-history

This commit is contained in:
Gustavo Maximiliano Cortez 2015-12-03 17:44:02 -03:00
commit 821db133c8
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 12 additions and 6 deletions

View file

@ -12,5 +12,5 @@
<!-- <img style="height:1em" ng&#45;show="index.preferences.email" src="img/icon&#45;email.svg"> --> <!-- <img style="height:1em" ng&#45;show="index.preferences.email" src="img/icon&#45;email.svg"> -->
<img style="height:1em" ng-show="index.usingCustomBWS" src="img/icon-bws.svg"> <img style="height:1em" ng-show="index.usingCustomBWS" src="img/icon-bws.svg">
<img style="height:1em" class="animated flash infinite" ng-show="index.updatingTxHistory[index.walletId]" src="img/icon-sync.svg"> <img style="height:1em" class="animated flash infinite" ng-show="index.loadingWallet" src="img/icon-sync.svg">

View file

@ -173,21 +173,22 @@
<!-- Activity --> <!-- Activity -->
<h4 class="title m0" translate>Activity</h4> <h4 class="title m0" translate>Activity</h4>
<div class="row m20t" ng-show="!index.updatingTxHistory[index.walletId] && !index.txHistory[0]"> <div class="row"
ng-show="!index.loadingWallet && !index.txHistory[0]">
<div class="large-12 columns"> <div class="large-12 columns">
<div class="oh text-center"> <div class="oh text-gray size-12 text-center">
<span ng-if="!index.txHistoryError" translate> <span ng-if="!index.txHistoryError" translate>
No transactions yet No transactions yet
</span> </span>
<span ng-show="index.txHistoryError && !index.notAuthorized" ng-click='index.updateTxHistory()'> <span ng-show="index.txHistoryError && !index.notAuthorized" ng-click='index.updateTxHistory()'>
<p class="size-12 m10b db text-gray" translate>Could not fetch transaction history</p> <p translate>Could not fetch transaction history</p>
<button class="outline round light-gray tiny" translate>Tap to retry</button> <button class="outline round light-gray tiny" translate>Tap to retry</button>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
<div ng-show="index.updatingTxHistory[index.walletId]"> <div ng-show="index.updatingTxHistory[index.walletId] && index.txProgress > 6">
<div class="row p20 text-center" ng-show="index.txProgress > 6"> <div class="row p20 text-center">
<div class="columns large-12 medium-12 small-12 m10b"> <div class="columns large-12 medium-12 small-12 m10b">
<div class="spinner"> <div class="spinner">
<div class="rect1"></div> <div class="rect1"></div>

View file

@ -64,6 +64,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
if (!fc) return; if (!fc) return;
// loading full wallet
self.loadingWallet = true;
// Clean status // Clean status
self.totalBalanceSat = null; self.totalBalanceSat = null;
self.lockedBalanceSat = null; self.lockedBalanceSat = null;
@ -923,6 +926,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$timeout(function() { $timeout(function() {
self.updateLocalTxHistory(fc, function(err) { self.updateLocalTxHistory(fc, function(err) {
self.updatingTxHistory[walletId] = false; self.updatingTxHistory[walletId] = false;
self.loadingWallet = false;
self.txProgress = 0;
if (err) if (err)
self.txHistoryError = true; self.txHistoryError = true;