From 3185d6baf5e443db5f802b60cdd4a7b93b76c701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 20 Mar 2020 13:57:29 +0100 Subject: [PATCH] EventIndex: Add some logging to the file panel populating. --- src/indexing/EventIndex.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index abd6bcab6c..9e27451a78 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -716,14 +716,20 @@ export default class EventIndex extends EventEmitter { } }); + let ret = false; + let paginationToken = ""; + // Set the pagination token to the oldest event that we retrieved. if (matrixEvents.length > 0) { - timeline.setPaginationToken(matrixEvents[matrixEvents.length - 1].getId(), EventTimeline.BACKWARDS); - return true; - } else { - timeline.setPaginationToken("", EventTimeline.BACKWARDS); - return false; + paginationToken = matrixEvents[matrixEvents.length - 1].getId(); + ret = true; } + + console.log("EventIndex: Populating file panel with", matrixEvents.length, + "events and setting the pagination token to", paginationToken); + + timeline.setPaginationToken(paginationToken, EventTimeline.BACKWARDS); + return ret; } /**