From ea609d8ea9c105692d4b6695e8c1f778b443d97c Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:25:19 +0530 Subject: [PATCH] fix cached scroll top position ignored when value is 0 (on top) --- src/app/features/room/hooks/useTimeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');