forked from AkkomaGang/akkoma-fe
Use since_id when pulling the current chat messages
This commit is contained in:
parent
fdef990c6a
commit
6c2c0883ce
|
@ -91,6 +91,7 @@ const Chat = {
|
||||||
currentUser: state => state.users.currentUser,
|
currentUser: state => state.users.currentUser,
|
||||||
isMobileLayout: state => state.interface.mobileLayout,
|
isMobileLayout: state => state.interface.mobileLayout,
|
||||||
openedChats: state => state.chats.openedChats,
|
openedChats: state => state.chats.openedChats,
|
||||||
|
openedChatMessageServices: state => state.chats.openedChatMessageServices,
|
||||||
windowHeight: state => state.interface.layoutHeight
|
windowHeight: state => state.interface.layoutHeight
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -263,7 +264,10 @@ const Chat = {
|
||||||
positionBeforeLoading = this.getPosition()
|
positionBeforeLoading = this.getPosition()
|
||||||
previousScrollTop = this.$refs.scrollable.scrollTop
|
previousScrollTop = this.$refs.scrollable.scrollTop
|
||||||
}
|
}
|
||||||
this.backendInteractor.chatMessages({ id: chatId, maxId })
|
const chatMessageService = this.openedChatMessageServices[chatId]
|
||||||
|
const sinceId = chatMessageService.lastMessage && chatMessageService.lastMessage.id
|
||||||
|
|
||||||
|
this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId })
|
||||||
.then((messages) => {
|
.then((messages) => {
|
||||||
let bottomedOut = this.bottomedOut()
|
let bottomedOut = this.bottomedOut()
|
||||||
this.loadingOlderMessages = false
|
this.loadingOlderMessages = false
|
||||||
|
|
|
@ -332,11 +332,11 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
|
||||||
dispatch('fetchEmojiReactionsBy', notification.status.id)
|
dispatch('fetchEmojiReactionsBy', notification.status.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.type === 'pleroma:chat_mention') {
|
// if (notification.type === 'pleroma:chat_mention') {
|
||||||
dispatch('addChatMessages', { chatId: notification.chatMessage.chat_id, messages: [notification.chatMessage] })
|
// dispatch('addChatMessages', { chatId: notification.chatMessage.chat_id, messages: [notification.chatMessage] })
|
||||||
dispatch('updateChatByAccountId', { accountId: notification.from_profile.id })
|
// dispatch('updateChatByAccountId', { accountId: notification.from_profile.id })
|
||||||
// dispatch('updateUnreadChatCount', { userId, unreadChatCount })
|
// // dispatch('updateUnreadChatCount', { userId, unreadChatCount })
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Only add a new notification if we don't have one for the same action
|
// Only add a new notification if we don't have one for the same action
|
||||||
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
|
if (!state.notifications.idStore.hasOwnProperty(notification.id)) {
|
||||||
|
|
Loading…
Reference in a new issue