Refresh list of pending transactions proposals after any events

This commit is contained in:
Gustavo Maximiliano Cortez 2014-11-07 12:22:05 -03:00
commit 431a66eeb2
6 changed files with 108 additions and 129 deletions

View file

@ -16,24 +16,10 @@ angular.module('copayApp.controllers').controller('HistoryController',
$scope.blockchain_txs = [];
$scope.alternativeCurrency = [];
var satToUnit = 1 / w.settings.unitToSatoshi;
$scope.update = function() {
$scope.loading = true;
var from = ($scope.txpCurrentPage - 1) * $scope.txpItemsPerPage;
var opts = {
pending: false,
skip: [from, from + $scope.txpItemsPerPage]
};
controllerUtils.updateTxs(opts);
setTimeout(function() {
$rootScope.$digest();
}, 0);
$scope.getTransactions();
};
$scope.show = function() {
$scope.loading = true;
setTimeout(function() {
@ -61,9 +47,6 @@ angular.module('copayApp.controllers').controller('HistoryController',
_.each(res, function(r) {
r.ts = r.minedTs || r.sentTs;
if (r.action === 'sent' && r.peerActions) {
r.actionList = controllerUtils.getActionList(r.peerActions);
}
});
$scope.blockchain_txs = w.cached_txs = res;
$scope.loading = false;
@ -76,13 +59,11 @@ angular.module('copayApp.controllers').controller('HistoryController',
$scope.hasAction = function(actions, action) {
return actions.hasOwnProperty('create');
}
};
$scope.getShortNetworkName = function() {
var w = $rootScope.wallet;
return w.getNetworkName().substring(0, 4);
};
// Autoload transactions
$scope.getTransactions();
});

View file

@ -72,11 +72,8 @@ angular.module('copayApp.controllers').controller('SendController',
});
$scope.loadTxs = function() {
var opts = {
pending: true,
skip: null
};
controllerUtils.updateTxs(opts);
controllerUtils.updateTxs();
setTimeout(function() {
$scope.loading = false;
$rootScope.$digest();

View file

@ -72,10 +72,6 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
if (controllerUtils.isFocusedWallet(wid)) return;
var w = $rootScope.iden.getWalletById(wid);
$scope.wallets.push(w);
controllerUtils.updateTxs({
wallet: w,
pending: true
});
controllerUtils.updateBalance(w, function() {
$rootScope.$digest();
})