aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2021-02-18 10:14:45 +0200
committerShpuld Shpuldson <shp@cock.li>2021-02-18 10:14:45 +0200
commit67f3532ac95b2a8740ccbde581e74ac65eb20a9a (patch)
tree6eec85a00ae9a7e45581e42a82165614341800e6 /src
parentee1cf36d523126630c20b0de0498207bafa14b3d (diff)
add additional check with timeout
Diffstat (limited to 'src')
-rw-r--r--src/components/chat/chat.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js
index f446f25b..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,7 +248,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)
+ 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