Implemented ability to quickly add a user to a group
This commit is contained in:
parent
190cd9408b
commit
22bf3ebcc0
30 changed files with 855 additions and 70 deletions
|
@ -130,6 +130,7 @@ export type ConversationType = {
|
|||
areWePendingApproval?: boolean;
|
||||
canChangeTimer?: boolean;
|
||||
canEditGroupInfo?: boolean;
|
||||
canAddNewMembers?: boolean;
|
||||
color?: AvatarColorType;
|
||||
conversationColor?: ConversationColorType;
|
||||
customColor?: CustomColorType;
|
||||
|
@ -803,6 +804,7 @@ export type ConversationActionType =
|
|||
// Action Creators
|
||||
|
||||
export const actions = {
|
||||
addMemberToGroup,
|
||||
cancelConversationVerification,
|
||||
changeHasGroupLink,
|
||||
clearCancelledConversationVerification,
|
||||
|
@ -2004,6 +2006,25 @@ function removeMemberFromGroup(
|
|||
};
|
||||
}
|
||||
|
||||
function addMemberToGroup(
|
||||
conversationId: string,
|
||||
contactId: string,
|
||||
onComplete: () => void
|
||||
): ThunkAction<void, RootStateType, unknown, never> {
|
||||
return async () => {
|
||||
const conversationModel = window.ConversationController.get(conversationId);
|
||||
if (conversationModel) {
|
||||
const idForLogging = conversationModel.idForLogging();
|
||||
await longRunningTaskWrapper({
|
||||
name: 'addMemberToGroup',
|
||||
idForLogging,
|
||||
task: () => conversationModel.addMembersV2([contactId]),
|
||||
});
|
||||
onComplete();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function toggleGroupsForStorySend(
|
||||
conversationIds: Array<string>
|
||||
): ThunkAction<void, RootStateType, unknown, NoopActionType> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue