Move to uuids for untrusted conversations needing verification
This commit is contained in:
parent
d3f9b656dd
commit
d446aa9e6b
12 changed files with 138 additions and 101 deletions
|
@ -1011,13 +1011,13 @@ export const getConversationsStoppedForVerification = createSelector(
|
|||
}
|
||||
);
|
||||
|
||||
export const getConversationIdsStoppingSend = createSelector(
|
||||
export const getConversationUuidsStoppingSend = createSelector(
|
||||
getConversationVerificationData,
|
||||
(pendingData): Array<string> => {
|
||||
const result = new Set<string>();
|
||||
Object.values(pendingData).forEach(item => {
|
||||
if (item.type === ConversationVerificationState.PendingVerification) {
|
||||
item.conversationsNeedingVerification.forEach(conversationId => {
|
||||
item.uuidsNeedingVerification.forEach(conversationId => {
|
||||
result.add(conversationId);
|
||||
});
|
||||
}
|
||||
|
@ -1027,20 +1027,13 @@ export const getConversationIdsStoppingSend = createSelector(
|
|||
);
|
||||
|
||||
export const getConversationsStoppingSend = createSelector(
|
||||
getConversationByIdSelector,
|
||||
getConversationIdsStoppingSend,
|
||||
getConversationSelector,
|
||||
getConversationUuidsStoppingSend,
|
||||
(
|
||||
conversationSelector: (id: string) => undefined | ConversationType,
|
||||
conversationIds: ReadonlyArray<string>
|
||||
conversationSelector: GetConversationByIdType,
|
||||
uuids: 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 = uuids.map(uuid => conversationSelector(uuid));
|
||||
return sortByTitle(conversations);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue