From c113629b8c9739c818742cd0b6d26cb3278a5b5f Mon Sep 17 00:00:00 2001 From: Bingo <21344290@qq.com> Date: Fri, 21 Aug 2020 15:02:47 +0800 Subject: [PATCH 1/2] fix item sort. --- lib/history.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.js b/lib/history.js index a60123e..e2bce40 100644 --- a/lib/history.js +++ b/lib/history.js @@ -228,7 +228,7 @@ History.prototype._save = function(block) { this._items.unshift(block); - this._items = _.sortBy( this._items, 'height', false ); + this._items = _.orderBy( this._items, 'height', "desc" ); if(this._items.length > MAX_HISTORY) { From 4f3af39d4c977833dfa0e8dae6bd5691c38399d7 Mon Sep 17 00:00:00 2001 From: Bingo <21344290@qq.com> Date: Fri, 21 Aug 2020 15:17:35 +0800 Subject: [PATCH 2/2] fix chartHistory sort. --- lib/history.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.js b/lib/history.js index e2bce40..6afaf11 100644 --- a/lib/history.js +++ b/lib/history.js @@ -591,7 +591,7 @@ History.prototype.getCharts = function() if(this._callback !== null) { var chartHistory = _( this._items ) - .sortBy( 'height', false ) + .orderBy( 'height', "desc" ) // .filter(function (item) // { // return item.block.trusted;