diff --git a/src/app/features/room/hooks/useTimeline.ts b/src/app/features/room/hooks/useTimeline.ts index cd47f7f6..f078ef8b 100644 --- a/src/app/features/room/hooks/useTimeline.ts +++ b/src/app/features/room/hooks/useTimeline.ts @@ -142,7 +142,7 @@ export const useTimelineScrollRestore = ( if (scrollEl) { const scrollTop = timeline.range.scrollTopCache; const batch = timeline.batch.read; - if (scrollTop) { + if (typeof scrollTop === 'number') { scrollEl.scrollTo({ top: scrollTop, behavior: 'instant' }); } else if (batch.next.end && batch.messages.events.length > 0) { scrollToBottom(scrollEl, 'instant');