Fix scroll to new messages ()

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
plugins/chunter-resources/src/components

View File

@ -71,7 +71,7 @@
// For now loading all messages for documents with activity. Need to correct handle aggregation with pagination. // 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 // 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 const loadAll = isDocChannel
dataProvider = new ChannelDataProvider(attachedTo, _class, lastViewedTimestamp, selectedMessageId, loadAll) dataProvider = new ChannelDataProvider(attachedTo, _class, lastViewedTimestamp ?? 0, selectedMessageId, loadAll)
} }
} }
</script> </script>

View File

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