Skip to content

Commit

Permalink
Fix chat filter to find UnconfirmedDirectChats (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jan 18, 2021
1 parent 8ef9aa6 commit 936afa1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/website/public/reducers/chatsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConfirmedChat>;
const filter = {
chatId: updatedChat.chatId,
userId: chatFunctions.isDirectChat(updatedChat) ? updatedChat.them : undefined
};
const currentChat = chatFunctions.tryGetChat(state.chats, filter)[0] as Option<ConfirmedChat>;

if (currentChat) {
// These messages have just come from the server so are all of type LocalMessage
Expand Down

0 comments on commit 936afa1

Please sign in to comment.