EventIndex/FilePanel: Allow longer lines.

This commit is contained in:
Damir Jelić 2020-01-20 12:43:20 +01:00
parent 0b4b9d8d5d
commit 4cf44cf5a5
2 changed files with 7 additions and 12 deletions

View file

@ -62,8 +62,7 @@ const FilePanel = createReactClass({
}, },
); );
const filterId = await client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, const filterId = await client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, filter);
filter);
filter.filterId = filterId; filter.filterId = filterId;
const timelineSet = room.getOrCreateFilteredTimelineSet(filter); const timelineSet = room.getOrCreateFilteredTimelineSet(filter);

View file

@ -479,15 +479,13 @@ export default class EventIndex {
// Add the events to the live timeline of the file panel. // Add the events to the live timeline of the file panel.
matrixEvents.forEach(e => { matrixEvents.forEach(e => {
if (!timelineSet.eventIdToTimeline(e.getId())) { if (!timelineSet.eventIdToTimeline(e.getId())) {
timelineSet.addEventToTimeline(e, timeline, timelineSet.addEventToTimeline(e, timeline, direction == EventTimeline.BACKWARDS);
direction == EventTimeline.BACKWARDS);
} }
}); });
// Set the pagination token to the oldest event that we retrieved. // Set the pagination token to the oldest event that we retrieved.
if (matrixEvents.length > 0) { if (matrixEvents.length > 0) {
timeline.setPaginationToken(matrixEvents[matrixEvents.length - 1].getId(), timeline.setPaginationToken(matrixEvents[matrixEvents.length - 1].getId(), EventTimeline.BACKWARDS);
EventTimeline.BACKWARDS);
return true; return true;
} else { } else {
timeline.setPaginationToken("", EventTimeline.BACKWARDS); 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 // TODO this is from the js-sdk, this should probably be exposed to
// us through the js-sdk. // us through the js-sdk.
const moveWindowCap = (titmelineWindow, timeline, direction, limit) => { const moveWindowCap = (titmelineWindow, timeline, direction, limit) => {
const count = (direction == EventTimeline.BACKWARDS) ? const count = (direction === EventTimeline.BACKWARDS) ?
timeline.retreat(limit) : timeline.advance(limit); timeline.retreat(limit) : timeline.advance(limit);
if (count) { if (count) {
@ -509,7 +507,7 @@ export default class EventIndex {
const excess = timelineWindow._eventCount - timelineWindow._windowLimit; const excess = timelineWindow._eventCount - timelineWindow._windowLimit;
if (excess > 0) { if (excess > 0) {
timelineWindow.unpaginate(3, direction != EventTimeline.BACKWARDS); timelineWindow.unpaginate(3, direction !== EventTimeline.BACKWARDS);
} }
return true; return true;
} }
@ -532,8 +530,7 @@ export default class EventIndex {
const timelineSet = timelineWindow._timelineSet; const timelineSet = timelineWindow._timelineSet;
const token = timeline.timeline.getPaginationToken(direction); const token = timeline.timeline.getPaginationToken(direction);
const ret = await this.populateFileTimeline(timelineSet, timeline.timeline, const ret = await this.populateFileTimeline(timelineSet, timeline.timeline, room, limit, token, direction);
room, limit, token, direction);
moveWindowCap(timelineWindow, timeline, direction, limit); moveWindowCap(timelineWindow, timeline, direction, limit);
timeline.pendingPaginate = null; timeline.pendingPaginate = null;
@ -541,8 +538,7 @@ export default class EventIndex {
return ret; return ret;
}; };
const paginationPromise = paginationMethod(timelineWindow, tl, room, const paginationPromise = paginationMethod(timelineWindow, tl, room, direction, limit);
direction, limit);
tl.pendingPaginate = paginationPromise; tl.pendingPaginate = paginationPromise;
return paginationPromise; return paginationPromise;