diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index 58db31fe76..d0b5ce7e6f 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -945,7 +945,11 @@ export default { * Scrolls to the bottom of the list smoothly. */ smoothScrollToBottom() { - this.$nextTick(function() { + this.$nextTick(() => { + if (!this.$refs.scroller) { + return + } + if (this.isWindowVisible && (document.hasFocus() || this.isInCall)) { // scrollTo is used when the user is watching this.$refs.scroller.scrollTo({ @@ -970,7 +974,11 @@ export default { * Scrolls to the bottom of the list. */ scrollToBottom() { - this.$nextTick(function() { + this.$nextTick(() => { + if (!this.$refs.scroller) { + return + } + this.$refs.scroller.scrollTop = this.$refs.scroller.scrollHeight this.setChatScrolledToBottom(true) })