aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat/chat.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-10-17 19:24:07 +0300
committerHenry Jameson <me@hjkos.com>2020-10-17 19:24:07 +0300
commit29ff0be92cfd87ba95d1f78323794dfb1223b514 (patch)
tree79836b7fb5b3e325274a833c34fd4c5f6155ba2d /src/components/chat/chat.js
parenta463959a365a5d618a79c96a26f6506e700d6ea3 (diff)
parent3ca729d09880813420a263221cdc68bcca13a1fb (diff)
Merge remote-tracking branch 'origin/develop' into settings-changed
* origin/develop: (48 commits) fix/leftover-emoji-checkboxes-in-settings Apply 1 suggestion(s) to 1 file(s) Translated using Weblate (Spanish) Translated using Weblate (Persian) Translated using Weblate (Persian) Translated using Weblate (Polish) update changelog Stop click propagation when unhiding nsfw Fix Follow Requests title style Translated using Weblate (Persian) Translated using Weblate (Persian) Translated using Weblate (French) Added translation using Weblate (Persian) Translated using Weblate (Chinese (Traditional)) Translated using Weblate (Chinese (Simplified)) Translated using Weblate (Italian) Translated using Weblate (English) Translated using Weblate (English) Translated using Weblate (Basque) Translated using Weblate (Spanish) ...
Diffstat (limited to 'src/components/chat/chat.js')
-rw-r--r--src/components/chat/chat.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js
index 803abf69..34e723d0 100644
--- a/src/components/chat/chat.js
+++ b/src/components/chat/chat.js
@@ -5,6 +5,7 @@ import ChatMessage from '../chat_message/chat_message.vue'
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'
const BOTTOMED_OUT_OFFSET = 10
@@ -246,7 +247,7 @@ const Chat = {
const fetchOlderMessages = !!maxId
const sinceId = fetchLatest && chatMessageService.maxId
- this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId })
+ return this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId })
.then((messages) => {
// Clear the current chat in case we're recovering from a ws connection loss.
if (isFirstFetch) {
@@ -287,7 +288,7 @@ const Chat = {
},
doStartFetching () {
this.$store.dispatch('startFetchingCurrentChat', {
- fetcher: () => setInterval(() => this.fetchChat({ fetchLatest: true }), 5000)
+ fetcher: () => promiseInterval(() => this.fetchChat({ fetchLatest: true }), 5000)
})
this.fetchChat({ isFirstFetch: true })
},