From 287daac0858fd2d4143ce2e417d8b247939f20f5 Mon Sep 17 00:00:00 2001 From: ClemDee Date: Tue, 2 Jul 2019 09:58:04 +0200 Subject: [PATCH] Fix getMoreHistory to not return lastKnownHash --- www/common/sframe-common-mailbox.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/www/common/sframe-common-mailbox.js b/www/common/sframe-common-mailbox.js index 91da3e10f..d205d8826 100644 --- a/www/common/sframe-common-mailbox.js +++ b/www/common/sframe-common-mailbox.js @@ -180,7 +180,7 @@ define([ var txid = Util.uid(); execCommand('LOAD_HISTORY', { type: type, - count: count, + count: lastKnownHash ? count + 1 : count, txid: txid, lastKnownHash: lastKnownHash }, function (err, obj) { @@ -195,14 +195,16 @@ define([ historyState = false; return; } - messages.push({ - type: type, - content: { - msg: data.message, - time: data.time, - hash: data.hash - } - }); + if (data.hash !== lastKnownHash) { + messages.push({ + type: type, + content: { + msg: data.message, + time: data.time, + hash: data.hash + } + }); + } }; }; mailbox.getNotificationsHistory = function (type, count, lastKnownHash, cb) {