aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat/chat.js
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2021-02-22 18:11:27 +0200
committerShpuld Shpuldson <shp@cock.li>2021-02-22 18:11:27 +0200
commit485f4b899ccad57694b7a45535936b7a5de8c4fb (patch)
tree4df146dc91d5222b1586f42c7f2536109e7a01a5 /src/components/chat/chat.js
parent98cb9abac773e8fbce94eafea1025919b6f26360 (diff)
parent3d013630aee48863cda5ece9ddf9a291703eb1af (diff)
changelog conflict
Diffstat (limited to 'src/components/chat/chat.js')
-rw-r--r--src/components/chat/chat.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js
index e57fcb91..2780be75 100644
--- a/src/components/chat/chat.js
+++ b/src/components/chat/chat.js
@@ -234,6 +234,13 @@ const Chat = {
const scrollable = this.$refs.scrollable
return scrollable && scrollable.scrollTop <= 0
},
+ cullOlderCheck () {
+ window.setTimeout(() => {
+ if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) {
+ this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId)
+ }
+ }, 5000)
+ },
handleScroll: _.throttle(function () {
if (!this.currentChat) { return }
@@ -241,6 +248,7 @@ const Chat = {
this.fetchChat({ maxId: this.currentChatMessageService.minId })
} else if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) {
this.jumpToBottomButtonVisible = false
+ this.cullOlderCheck()
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