diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-11-06 12:55:57 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-11-06 12:55:57 +0000 |
| commit | 60983ae42b584694de0211ca67ef72d492a293c9 (patch) | |
| tree | 61f09d9cf2e9fc80142f1b903198eed24d46ca90 /src/components/chat/chat.js | |
| parent | dbeecd18acfc14920c49324e08600dadba7127d7 (diff) | |
| parent | 15ea9d8c917d6d0408a9c48f38976d19f9936054 (diff) | |
Merge branch 'chat-fix-for-vertical-screen' into 'develop'
Chat scroll fix for vertical screen
Closes #997
See merge request pleroma/pleroma-fe!1277
Diffstat (limited to 'src/components/chat/chat.js')
| -rw-r--r-- | src/components/chat/chat.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 2887afb5..e57fcb91 100644 --- 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, scrollableContainerHeight } from './chat_layout_utils.js' +import { getScrollPosition, getNewTopPosition, isBottomedOut, scrollableContainerHeight, isScrollable } from './chat_layout_utils.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronDown, @@ -287,6 +287,14 @@ const Chat = { if (isFirstFetch) { this.updateScrollableContainerHeight() } + + // In vertical screens, the first batch of fetched messages may not always take the + // 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 (!isScrollable(this.$refs.scrollable) && messages.length > 0) { + this.fetchChat({ maxId: this.currentChatMessageService.minId }) + } }) }) }) |
