This commit is contained in:
cubedro
2015-06-10 05:44:32 +03:00
parent a50a3b29f9
commit 60cd4bdf73
2 changed files with 9 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ var Collection = function Collection()
this._items = [];
this._blockchain = new Blockchain();
this._askedForHistory = false;
this._askedForHistoryTime = 0;
this._debounced = null;
return this;
@@ -294,9 +295,14 @@ Collection.prototype.askedForHistory = function(set)
if( !_.isUndefined(set) )
{
this._askedForHistory = set;
if(set === true)
{
this._askedForHistoryTime = _.now();
}
}
return this._askedForHistory;
return (this._askedForHistory || _.now() - this._askedForHistoryTime < 2*60*1000);
}
module.exports = Collection;