From 4ae23f1f2c71dd183b1ec7dc7043c8ec6e00b631 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Mon, 18 Jan 2021 09:38:24 +0000 Subject: [PATCH] Fix chat filter to find UnconfirmedDirectChats --- src/website/public/reducers/chatsReducer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/website/public/reducers/chatsReducer.ts b/src/website/public/reducers/chatsReducer.ts index d793c58df5..83ba01befe 100644 --- a/src/website/public/reducers/chatsReducer.ts +++ b/src/website/public/reducers/chatsReducer.ts @@ -180,7 +180,11 @@ export default produce((state: ChatsState, event: Event) => { const unconfirmedGroupChat = state.chats.find(c => c.kind === UNCONFIRMED_GROUP_CHAT) as UnconfirmedGroupChat; for (const updatedChat of chats) { - const currentChat = chatFunctions.tryGetChat(state.chats, { chatId: updatedChat.chatId })[0] as Option; + const filter = { + chatId: updatedChat.chatId, + userId: chatFunctions.isDirectChat(updatedChat) ? updatedChat.them : undefined + }; + const currentChat = chatFunctions.tryGetChat(state.chats, filter)[0] as Option; if (currentChat) { // These messages have just come from the server so are all of type LocalMessage