Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-12-15 15:21:15 +0300
committerGitHub <noreply@github.com>2021-12-15 15:21:15 +0300
commit95d407a4cadc30a0e9a554d54544cad8534dc201 (patch)
tree29129180c46a8621cfa838a91dc0c240364871dd
parent0a70498148dc9ed0a3caf86863f567450383d409 (diff)
parent7cc8c436eddbf0be187afce1f5b16c0aaae55bc6 (diff)
Merge pull request #6717 from nextcloud/backport/6716/stable23
[stable23] Prevent handleScroll on initial loading of a conversation
-rw-r--r--src/components/MessagesList/MessagesList.vue8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue
index 4cd449230..a87ab98b6 100644
--- a/src/components/MessagesList/MessagesList.vue
+++ b/src/components/MessagesList/MessagesList.vue
@@ -582,11 +582,19 @@ export default {
debounceHandleScroll: debounce(function() {
this.handleScroll()
}, 50),
+
/**
* When the div is scrolled, this method checks if it's been scrolled to the top
* or to the bottom of the list bottom.
*/
async handleScroll() {
+ if (!this.$store.getters.getFirstKnownMessageId(this.token)) {
+ // This can happen if the browser is fast enough to close the sidebar
+ // when switching from a one-to-one to a group conversation.
+ console.debug('Ignoring handleScroll as the messages history is empty')
+ return
+ }
+
const scrollHeight = this.scroller.scrollHeight
const scrollTop = this.scroller.scrollTop
const scrollOffset = scrollHeight - scrollTop