diff --git a/src/app/organisms/room/RoomViewContent.jsx b/src/app/organisms/room/RoomViewContent.jsx index 2b2a2749..f78cbdab 100644 --- a/src/app/organisms/room/RoomViewContent.jsx +++ b/src/app/organisms/room/RoomViewContent.jsx @@ -534,7 +534,8 @@ function RoomViewContent({ eventId, roomTimeline }) { timelineScroll.scrollToIndex(jumpToItemIndex, 80); } if (timelineScroll.bottom < 16 && !roomTimeline.canPaginateForward()) { - if (readEventStore.getItem()?.getId() === roomTimeline.getReadUpToEventId()) { + const readUpToId = roomTimeline.getReadUpToEventId(); + if (readEventStore.getItem()?.getId() === readUpToId || readUpToId === null) { requestAnimationFrame(() => roomTimeline.markAllAsRead()); } } diff --git a/src/app/organisms/room/RoomViewFloating.jsx b/src/app/organisms/room/RoomViewFloating.jsx index b85a28f2..1bec52d2 100644 --- a/src/app/organisms/room/RoomViewFloating.jsx +++ b/src/app/organisms/room/RoomViewFloating.jsx @@ -32,7 +32,7 @@ function useJumpToEvent(roomTimeline) { // we only show "Jump to unread" btn only if the event is not in timeline. // if event is in timeline // we will automatically open the timeline from that event position - if (!readEventId.startsWith('~') && !roomTimeline.hasEventInTimeline(readEventId)) { + if (!readEventId?.startsWith('~') && !roomTimeline.hasEventInTimeline(readEventId)) { setEventId(readEventId); }