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

Commit 16cb4e6

Browse files
committed
Determine if event belongs to thread on jumping to event
This allows us to jump to any event in any thread, even if neither the thread nor the event are part of any timeline yet
1 parent a2e3e6d commit 16cb4e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/EventUtils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,11 @@ export async function fetchInitialEvent(
238238
) {
239239
const threadId = initialEvent.threadRootId;
240240
const room = client.getRoom(roomId);
241+
const mapper = client.getEventMapper();
242+
const rootEvent = room.findEventById(threadId)
243+
?? mapper(await client.fetchRoomEvent(roomId, threadId));
241244
try {
242-
room.createThread(threadId, room.findEventById(threadId), [initialEvent], true);
245+
room.createThread(threadId, rootEvent, [initialEvent], true);
243246
} catch (e) {
244247
logger.warn("Could not find root event: " + threadId);
245248
}

0 commit comments

Comments
 (0)