Guard against composer setting quote while conversation switched
This commit is contained in:
parent
3c80272673
commit
add184d0da
1 changed files with 10 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue