do not await for mark messages as seen

This commit is contained in:
Moriz Wahl 2023-07-17 19:52:41 +02:00
parent 27fe3068e0
commit 4b2fae9a2c

View File

@ -260,19 +260,22 @@ export default {
const newMsgIds = Message.filter((m) => m.seen === false).map((m) => m.id)
if (newMsgIds.length) {
await this.$apollo.mutate({
mutation: markMessagesAsSeen(),
variables: {
messageIds: newMsgIds,
},
})
this.$apollo
.query({
query: unreadRoomsQuery(),
fetchPolicy: 'network-only',
.mutate({
mutation: markMessagesAsSeen(),
variables: {
messageIds: newMsgIds,
},
})
.then(({ data: { UnreadRooms } }) => {
this.commitUnreadRoomCount(UnreadRooms)
.then(() => {
this.$apollo
.query({
query: unreadRoomsQuery(),
fetchPolicy: 'network-only',
})
.then(({ data: { UnreadRooms } }) => {
this.commitUnreadRoomCount(UnreadRooms)
})
})
}