From a312ce8e5c4fab5ebdd3bde6f3b9e808b9f64af6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 28 Feb 2024 18:35:51 +0100 Subject: [PATCH] feat(federation): Also utilize returned data from DELETE /read Signed-off-by: Joas Schilling --- src/store/conversationsStore.js | 5 ++--- src/store/messagesStore.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/store/conversationsStore.js b/src/store/conversationsStore.js index f7a968c76275..80dfd4bf5718 100644 --- a/src/store/conversationsStore.js +++ b/src/store/conversationsStore.js @@ -634,9 +634,8 @@ const actions = { return } - await setConversationUnread(token) - commit('updateUnreadMessages', { token, unreadMessages: 1 }) - await dispatch('fetchConversation', { token }) + const response = await setConversationUnread(token) + await dispatch('addConversation', response.data.ocs.data) }, async updateLastCommonReadMessage({ commit, getters }, { token, lastCommonReadMessage }) { diff --git a/src/store/messagesStore.js b/src/store/messagesStore.js index 0807a008324d..4020f150551d 100644 --- a/src/store/messagesStore.js +++ b/src/store/messagesStore.js @@ -823,7 +823,7 @@ const actions = { */ async clearLastReadMessage(context, { token, updateVisually = false }) { const conversation = context.getters.conversations[token] - if (!conversation || !conversation.lastMessage) { + if (!conversation/* FIXME || !conversation.lastMessage*/) { return } // set the id to the last message