diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index 79b1c85d80..45edca2681 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -258,6 +258,10 @@ function scrollToQuotedMessage({ return; } + if (getState().conversations.selectedConversationId !== conversationId) { + return; + } + scrollToMessage(conversationId, message.id)(dispatch, getState, undefined); }; } @@ -529,6 +533,12 @@ export function setQuoteByMessageId( if (message) { const quote = await conversation.makeQuote(message); + + // In case the conversation changed while we were about to set the quote + if (getState().conversations.selectedConversationId !== conversationId) { + return; + } + dispatch( setQuotedMessage({ conversationId,