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

Commit

Permalink
Apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dhenneke committed Sep 7, 2022
1 parent c89787d commit a90e147
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/stores/widgets/StopGapWidgetDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,10 @@ export class StopGapWidgetDriver extends WidgetDriver {
direction?: 'f' | 'b',
): Promise<IReadEventRelationsResult> {
const client = MatrixClientPeg.get();
const dir =
direction && Object.values(Direction as Record<string, string>).includes(direction)
? direction as Direction
: undefined;
const room = roomId !== undefined ? roomId : RoomViewStore.instance.getRoomId();
const dir = direction as Direction;
roomId = roomId ?? RoomViewStore.instance.getRoomId() ?? undefined;

if (typeof room !== "string") {
if (typeof roomId !== "string") {
throw new Error('Error while reading the current room');
}

Expand All @@ -396,7 +393,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
nextBatch,
prevBatch,
} = await client.relations(
room,
roomId,
eventId,
relationType ?? null,
eventType ?? null,
Expand Down

0 comments on commit a90e147

Please sign in to comment.