get rid of older messages when scrolling down in chat to keep it from bloating dom

This commit is contained in:
Shpuld Shpuldson 2021-02-17 10:16:58 +02:00
parent aa240f935f
commit 47770ed715
3 changed files with 24 additions and 0 deletions

View file

@ -241,6 +241,7 @@ const Chat = {
this.fetchChat({ maxId: this.currentChatMessageService.minId })
} else if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) {
this.jumpToBottomButtonVisible = false
this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId)
if (this.newMessageCount > 0) {
// Use a delay before marking as read to prevent situation where new messages
// arrive just as you're leaving the view and messages that you didn't actually