Ensure that untrusted conversations are always rendered in dialog

This commit is contained in:
Scott Nonnenberg 2022-06-01 14:32:40 -07:00 committed by GitHub
parent 08360d150c
commit feb5e569f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -1293,6 +1293,9 @@ function verifyConversationsStoppingSend(): ThunkAction<
conversationIdsStoppingSend.forEach(async conversationId => {
const conversation = window.ConversationController.get(conversationId);
if (!conversation) {
log.warn(
`verifyConversationsStoppingSend: Cannot verify missing conversation for conversationId ${conversationId}`
);
return;
}

View File

@ -1027,20 +1027,15 @@ export const getConversationIdsStoppingSend = createSelector(
);
export const getConversationsStoppingSend = createSelector(
getConversationByIdSelector,
getConversationSelector,
getConversationIdsStoppingSend,
(
conversationSelector: (id: string) => undefined | ConversationType,
conversationSelector: GetConversationByIdType,
conversationIds: ReadonlyArray<string>
): Array<ConversationType> => {
const conversations = conversationIds
.map(conversationId => conversationSelector(conversationId))
.filter(isNotNil);
if (conversationIds.length !== conversations.length) {
log.warn(
`getConversationsStoppingSend: Started with ${conversationIds.length} items, ended up with ${conversations.length}.`
);
}
const conversations = conversationIds.map(conversationId =>
conversationSelector(conversationId)
);
return sortByTitle(conversations);
}
);