Fix scroll to new messages (#5782)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-06-11 18:30:54 +04:00 committed by GitHub
parent 9585a1106f
commit 8e440b8f0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@
// For now loading all messages for documents with activity. Need to correct handle aggregation with pagination.
// Perhaps we should load all activity messages once, and keep loading in chunks only for ChatMessages then merge them correctly with activity messages
const loadAll = isDocChannel
dataProvider = new ChannelDataProvider(attachedTo, _class, lastViewedTimestamp, selectedMessageId, loadAll)
dataProvider = new ChannelDataProvider(attachedTo, _class, lastViewedTimestamp ?? 0, selectedMessageId, loadAll)
}
}
</script>

View File

@ -425,9 +425,9 @@
autoscroll = false
})
} else if (separatorElement) {
isScrollInitialized = true
await wait()
scrollToSeparator()
isScrollInitialized = true
isInitialScrolling = false
}
}
@ -554,7 +554,7 @@
beforeUpdate(() => {
if (!scrollElement) return
if (scrollElement.scrollHeight === scrollElement.clientHeight) {
if (isScrollInitialized && scrollElement.scrollHeight === scrollElement.clientHeight) {
isScrollAtBottom = true
}
})