fix cached scroll top position ignored when value is 0 (on top)

This commit is contained in:
Ajay Bura 2026-10-27 22:25:19 +05:30
commit ea609d8ea9

View file

@ -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');