Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Smaller changes
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
  • Loading branch information
Mikhail Aheichyk committed Feb 27, 2024
1 parent a7143bb commit 1e203cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/stores/widgets/StopGapWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ export class StopGapWidget extends EventEmitter {
return;
}

let isBeforeMark = true;
// should be true to forward the event to the widget
let shouldForward = false;

const room = this.client.getRoom(ev.getRoomId()!);
if (!room) return;
Expand All @@ -520,12 +521,13 @@ export class StopGapWidget extends EventEmitter {
if (timelineEvent.getId() === upToEventId) {
break;
} else if (timelineEvent.getId() === ev.getId()) {
isBeforeMark = false;
shouldForward = true;
break;
}
}

if (isBeforeMark) {
if (!shouldForward) {
// checks that the event has a relation to unknown event
isRelationToUnknown =
!ev.replyEventId && !!ev.relationEventId && !room.findEventById(ev.relationEventId);
if (!isRelationToUnknown) {
Expand Down

0 comments on commit 1e203cb

Please sign in to comment.