Skip to content

Commit

Permalink
Disable pending events for thread list when server supports threads (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
Germain authored Mar 8, 2022
1 parent 2ce1e7e commit 2ac9448
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/models/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export interface ICreateFilterOpts {
// timeline. Useful to disable for some filters that can't be achieved by the
// client in an efficient manner
prepopulateTimeline?: boolean;
pendingEvents?: boolean;
}

export enum RoomEvent {
Expand Down Expand Up @@ -1315,12 +1316,15 @@ export class Room extends TypedEventEmitter<EmittedEvents, RoomEventHandlerMap>
*/
public getOrCreateFilteredTimelineSet(
filter: Filter,
{ prepopulateTimeline = true }: ICreateFilterOpts = {},
{
prepopulateTimeline = true,
pendingEvents = true,
}: ICreateFilterOpts = {},
): EventTimelineSet {
if (this.filteredTimelineSets[filter.filterId]) {
return this.filteredTimelineSets[filter.filterId];
}
const opts = Object.assign({ filter: filter }, this.opts);
const opts = Object.assign({ filter, pendingEvents }, this.opts);
const timelineSet = new EventTimelineSet(this, opts);
this.reEmitter.reEmit(timelineSet, [
RoomEvent.Timeline,
Expand Down

0 comments on commit 2ac9448

Please sign in to comment.