commit: 0a606c2720734f941a22b14b3460aaa4a500db4b
parent cfa8edf2c075d16e3b04f4a6463657eb777c623c
Author: Henry Jameson <me@hjkos.com>
Date: Tue, 5 Apr 2022 17:11:50 +0300
fix chat loading endlessly
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js
@@ -6,7 +6,7 @@ import PostStatusForm from '../post_status_form/post_status_form.vue'
import ChatTitle from '../chat_title/chat_title.vue'
import chatService from '../../services/chat_service/chat_service.js'
import { promiseInterval } from '../../services/promise_interval/promise_interval.js'
-import { getScrollPosition, getNewTopPosition, isBottomedOut } from './chat_layout_utils.js'
+import { getScrollPosition, getNewTopPosition, isBottomedOut, isScrollable } from './chat_layout_utils.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChevronDown,
@@ -281,7 +281,7 @@ const Chat = {
// full height of the scrollable container.
// If this is the case, we want to fetch the messages until the scrollable container
// is fully populated so that the user has the ability to scroll up and load the history.
- if (messages.length > 0) {
+ if (!isScrollable(scroller()) && messages.length > 0) {
this.fetchChat({ maxId: this.currentChatMessageService.minId })
}
})