From 4cf44cf5a561f801c107b121f109e18236db0e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 20 Jan 2020 12:43:20 +0100 Subject: [PATCH] EventIndex/FilePanel: Allow longer lines. --- src/components/structures/FilePanel.js | 3 +-- src/indexing/EventIndex.js | 16 ++++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/structures/FilePanel.js b/src/components/structures/FilePanel.js index cb788cd6d2..71e8143f0a 100644 --- a/src/components/structures/FilePanel.js +++ b/src/components/structures/FilePanel.js @@ -62,8 +62,7 @@ const FilePanel = createReactClass({ }, ); - const filterId = await client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, - filter); + const filterId = await client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, filter); filter.filterId = filterId; const timelineSet = room.getOrCreateFilteredTimelineSet(filter); diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index e361f66edc..cb77d92c27 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -479,15 +479,13 @@ export default class EventIndex { // Add the events to the live timeline of the file panel. matrixEvents.forEach(e => { if (!timelineSet.eventIdToTimeline(e.getId())) { - timelineSet.addEventToTimeline(e, timeline, - direction == EventTimeline.BACKWARDS); + timelineSet.addEventToTimeline(e, timeline, direction == EventTimeline.BACKWARDS); } }); // Set the pagination token to the oldest event that we retrieved. if (matrixEvents.length > 0) { - timeline.setPaginationToken(matrixEvents[matrixEvents.length - 1].getId(), - EventTimeline.BACKWARDS); + timeline.setPaginationToken(matrixEvents[matrixEvents.length - 1].getId(), EventTimeline.BACKWARDS); return true; } else { timeline.setPaginationToken("", EventTimeline.BACKWARDS); @@ -501,7 +499,7 @@ export default class EventIndex { // TODO this is from the js-sdk, this should probably be exposed to // us through the js-sdk. const moveWindowCap = (titmelineWindow, timeline, direction, limit) => { - const count = (direction == EventTimeline.BACKWARDS) ? + const count = (direction === EventTimeline.BACKWARDS) ? timeline.retreat(limit) : timeline.advance(limit); if (count) { @@ -509,7 +507,7 @@ export default class EventIndex { const excess = timelineWindow._eventCount - timelineWindow._windowLimit; if (excess > 0) { - timelineWindow.unpaginate(3, direction != EventTimeline.BACKWARDS); + timelineWindow.unpaginate(3, direction !== EventTimeline.BACKWARDS); } return true; } @@ -532,8 +530,7 @@ export default class EventIndex { const timelineSet = timelineWindow._timelineSet; const token = timeline.timeline.getPaginationToken(direction); - const ret = await this.populateFileTimeline(timelineSet, timeline.timeline, - room, limit, token, direction); + const ret = await this.populateFileTimeline(timelineSet, timeline.timeline, room, limit, token, direction); moveWindowCap(timelineWindow, timeline, direction, limit); timeline.pendingPaginate = null; @@ -541,8 +538,7 @@ export default class EventIndex { return ret; }; - const paginationPromise = paginationMethod(timelineWindow, tl, room, - direction, limit); + const paginationPromise = paginationMethod(timelineWindow, tl, room, direction, limit); tl.pendingPaginate = paginationPromise; return paginationPromise;