From 98e7d50b730fe6991e3af0221bbe21c26d2b39f2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 26 Nov 2020 16:21:46 +1100 Subject: [PATCH] do not create the convo when fetching avatar. if the convo is not here, it's likely it was removed by the user itself. --- ts/state/ducks/conversations.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 993378775..a226b9e6a 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -472,10 +472,12 @@ export function reducer( if (action.type === 'CONVERSATION_REMOVED') { const { payload } = action; const { id } = payload; - const { conversationLookup } = state; + const { conversationLookup, selectedConversation } = state; return { ...state, conversationLookup: omit(conversationLookup, [id]), + selectedConversation: + selectedConversation === id ? undefined : selectedConversation, }; } if (action.type === 'CONVERSATIONS_REMOVE_ALL') {