diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-12-15 15:21:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 15:21:15 +0300 |
commit | 95d407a4cadc30a0e9a554d54544cad8534dc201 (patch) | |
tree | 29129180c46a8621cfa838a91dc0c240364871dd | |
parent | 0a70498148dc9ed0a3caf86863f567450383d409 (diff) | |
parent | 7cc8c436eddbf0be187afce1f5b16c0aaae55bc6 (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.vue | 8 |
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 |