-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorten TimelineWindow when an event is removed #3862
Conversation
7114c3b
to
6b40017
Compare
Needed for the fix for element-hq/element-web#26498
6b40017
to
06c7f99
Compare
@@ -87,6 +92,7 @@ export class TimelineWindow { | |||
opts: IOpts = {}, | |||
) { | |||
this.windowLimit = opts.windowLimit || 1000; | |||
timelineSet.room?.on(RoomEvent.Timeline, this.onTimelineEvent.bind(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bind is superfluous, you're using an arrow function already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed in 7242aaa . I meant to declare it without the arrow function to match the surrounding code, but failed to update it after copy-pasting from somewhere else.
Fixes element-hq/element-web#26498 even when #3798 is present.
Listen for events being removed in the TimelineWIndow, and shorten the window if the removal makes it longer than the available events.
Here's what your changelog entry will look like:
🐛 Bug Fixes