fix: disable resend button when member is pending removal

pull/3281/head
Audric Ackermann 10 months ago
parent c90b84ca92
commit 1bf1c5e47a
No known key found for this signature in database

@ -247,13 +247,19 @@ const ResendButton = ({ groupPk, pubkey }: { pubkey: PubkeyType; groupPk: GroupP
if (!shouldShowResendButton) { if (!shouldShowResendButton) {
return null; return null;
} }
const resendButtonDisabled =
memberStatus === 'INVITE_SENDING' ||
memberStatus === 'PROMOTION_SENDING' ||
memberStatus === 'REMOVED_MEMBER' ||
memberStatus === 'REMOVED_MEMBER_AND_MESSAGES' ||
memberStatus === 'REMOVED_UNKNOWN';
return ( return (
<SessionButton <SessionButton
dataTestId={'resend-invite-button'} dataTestId={'resend-invite-button'}
buttonShape={SessionButtonShape.Square} buttonShape={SessionButtonShape.Square}
buttonType={SessionButtonType.Solid} buttonType={SessionButtonType.Solid}
text={window.i18n('resend')} text={window.i18n('resend')}
disabled={memberStatus === 'INVITE_SENDING' || memberStatus === 'PROMOTION_SENDING'} disabled={resendButtonDisabled}
onClick={async () => { onClick={async () => {
const group = await UserGroupsWrapperActions.getGroup(groupPk); const group = await UserGroupsWrapperActions.getGroup(groupPk);
const member = await MetaGroupWrapperActions.memberGet(groupPk, pubkey); const member = await MetaGroupWrapperActions.memberGet(groupPk, pubkey);

Loading…
Cancel
Save