Moves parts of conversation view into redux
This commit is contained in:
parent
a49a6f2057
commit
9348940ecf
27 changed files with 693 additions and 461 deletions
25
ts/util/isMemberRequestingToJoin.ts
Normal file
25
ts/util/isMemberRequestingToJoin.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { UUID } from '../types/UUID';
|
||||
import type { ConversationAttributesType } from '../model-types.d';
|
||||
import { isGroupV2 } from './whatTypeOfConversation';
|
||||
|
||||
export function isMemberRequestingToJoin(
|
||||
conversationAttrs: Pick<
|
||||
ConversationAttributesType,
|
||||
'groupId' | 'groupVersion' | 'pendingAdminApprovalV2'
|
||||
>,
|
||||
uuid: UUID
|
||||
): boolean {
|
||||
if (!isGroupV2(conversationAttrs)) {
|
||||
return false;
|
||||
}
|
||||
const { pendingAdminApprovalV2 } = conversationAttrs;
|
||||
|
||||
if (!pendingAdminApprovalV2 || !pendingAdminApprovalV2.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return pendingAdminApprovalV2.some(item => item.uuid === uuid.toString());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue