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

@ -795,7 +795,7 @@ angular.module('copayApp.services')
root.getNotifications = function(opts, cb) {
opts = opts || {};
var TIME_STAMP = 60 * 60 * 24 * 7;
var TIME_STAMP = 60 * 60 * 24;
var MAX = 100;
var typeFilter = {
@ -861,26 +861,25 @@ angular.module('copayApp.services')
var finale = shown; // GROUPING DISABLED!
// var finale = [],
// prev;
//
//
// // Item grouping... DISABLED.
//
// // REMOVE (if we want 1-to-1 notification) ????
// lodash.each(shown, function(x) {
// if (prev && prev.walletId === x.walletId && prev.txpId && prev.txpId === x.txpId && prev.creatorId && prev.creatorId === x.creatorId) {
// prev.types.push(x.type);
// prev.data = lodash.assign(prev.data, x.data);
// prev.txid = prev.txid || x.txid;
// prev.amountStr = prev.amountStr || x.amountStr;
// prev.creatorName = prev.creatorName || x.creatorName;
// } else {
// finale.push(x);
// prev = x;
// }
// });
//
var finale = [],
prev;
// Item grouping... DISABLED.
// REMOVE (if we want 1-to-1 notification) ????
lodash.each(shown, function(x) {
if (prev && prev.walletId === x.walletId && prev.txpId && prev.txpId === x.txpId && prev.creatorId && prev.creatorId === x.creatorId) {
prev.types.push(x.type);
prev.data = lodash.assign(prev.data, x.data);
prev.txid = prev.txid || x.txid;
prev.amountStr = prev.amountStr || x.amountStr;
prev.creatorName = prev.creatorName || x.creatorName;
} else {
finale.push(x);
prev = x;
}
});
var u = bwcService.getUtils();
lodash.each(finale, function(x) {