Skip to content

Commit

Permalink
[wip]
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Feb 17, 2025
1 parent 4925e01 commit 4729338
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/MessagesList/MessagesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ export default {
this.$refs.scroller.scrollTo({
top: this.$refs.scroller.scrollHeight,
})
} else if (this.$refs.scroller.clientHeight === this.$refs.scroller.scrollHeight) {
// chat is not scrollable
this.setChatScrolledToBottom(true)
}
},

Expand Down Expand Up @@ -924,14 +927,18 @@ export default {
const scrollOffset = scrollHeight - scrollTop

// For chats that are scrolled to bottom and not fitted in one screen
// console.log('scroll', this.hasMoreMessagesToLoad)
// console.log(this.hasMoreMessagesToLoad, this.conversation.lastMessage?.timestamp * 1000, +this.messagesList.at(-1).id.replace('temp-', ''))
if (Math.abs(scrollOffset - clientHeight) < SCROLL_TOLERANCE && !this.hasMoreMessagesToLoad && scrollTop > 0) {
this.setChatScrolledToBottom(true)
this.displayMessagesLoader = false
this.debounceUpdateReadMarkerPosition()
return
}

this.setChatScrolledToBottom(false)
if (scrollHeight > clientHeight) {
this.setChatScrolledToBottom(false)
}

if ((scrollHeight > clientHeight && scrollTop < 800 && this.isScrolling === 'up')
|| skipHeightCheck) {
Expand Down Expand Up @@ -1118,6 +1125,7 @@ export default {
return
}

// console.log('check', this.hasMoreMessagesToLoad)
let newTop
if (options?.force) {
newTop = this.$refs.scroller.scrollHeight
Expand Down

0 comments on commit 4729338

Please sign in to comment.