From 4b2fae9a2c15c5a6fd38f3f71c878e2f06aa530b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 17 Jul 2023 19:52:41 +0200 Subject: [PATCH] do not await for mark messages as seen --- webapp/components/Chat/Chat.vue | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 05472c56f..43994ef5d 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -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) + }) }) }