Fix recent transactions. Show the latest transactions within 24 hours

This commit is contained in:
Gustavo Maximiliano Cortez 2016-11-10 13:47:57 -03:00
commit 5ead443c24
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
6 changed files with 56 additions and 127 deletions

View file

@ -26,7 +26,10 @@ angular.module('copayApp.controllers').controller('activityController',
$scope.openNotificationModal = function(n) {
if (n.txid) {
openTxModal(n);
$state.transitionTo('tabs.wallet.tx-details', {
txid: n.txid,
walletId: n.walletId
});
} else {
var txp = lodash.find($scope.txps, {
id: n.txpId
@ -46,35 +49,4 @@ angular.module('copayApp.controllers').controller('activityController',
}
}
};
var openTxModal = function(n) {
var wallet = profileService.getWallet(n.walletId);
ongoingProcess.set('loadingTxInfo', true);
walletService.getTx(wallet, n.txid, function(err, tx) {
ongoingProcess.set('loadingTxInfo', false);
if (err) {
$log.error(err);
return popupService.showAlert(gettextCatalog.getString('Error'), err);
}
if (!tx) {
$log.warn('No tx found');
return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found'));
}
$scope.wallet = wallet;
$scope.btx = lodash.cloneDeep(tx);
$state.transitionTo('tabs.wallet.tx-details', {
txid: $scope.btx.txid,
walletId: $scope.walletId
});
walletService.getTxNote(wallet, n.txid, function(err, note) {
if (err) $log.warn('Could not fetch transaction note: ' + err);
$scope.btx.note = note;
});
});
};
});