diff --git a/ts/components/session/menu/ConversationHeaderMenu.tsx b/ts/components/session/menu/ConversationHeaderMenu.tsx index caa274622..f0a0454a9 100644 --- a/ts/components/session/menu/ConversationHeaderMenu.tsx +++ b/ts/components/session/menu/ConversationHeaderMenu.tsx @@ -125,6 +125,7 @@ export const ConversationHeaderMenu = (props: PropsConversationHeaderMenu) => { isMe, isGroup, isPublic, + left, onDeleteContact, window.i18n )} diff --git a/ts/components/session/menu/ConversationListItemContextMenu.tsx b/ts/components/session/menu/ConversationListItemContextMenu.tsx index f18bb260d..5d0ea6ff2 100644 --- a/ts/components/session/menu/ConversationListItemContextMenu.tsx +++ b/ts/components/session/menu/ConversationListItemContextMenu.tsx @@ -92,6 +92,7 @@ export const ConversationListItemContextMenu = ( isMe, type === 'group', isPublic, + left, onDeleteContact, window.i18n )} diff --git a/ts/components/session/menu/Menu.tsx b/ts/components/session/menu/Menu.tsx index 87072aad1..bb0be3d15 100644 --- a/ts/components/session/menu/Menu.tsx +++ b/ts/components/session/menu/Menu.tsx @@ -39,9 +39,11 @@ function showCopyId(isPublic: boolean, isGroup: boolean): boolean { function showDeleteContact( isMe: boolean, isGroup: boolean, - isPublic: boolean + isPublic: boolean, + isGroupLeft: boolean ): boolean { - return !isMe && Boolean(!isGroup || isPublic); + // you need to have left a closed group first to be able to delete it completely. + return (!isMe && !isGroup) || (isGroup && isGroupLeft); } function showAddModerators( @@ -97,10 +99,18 @@ export function getDeleteContactMenuItem( isMe: boolean | undefined, isGroup: boolean | undefined, isPublic: boolean | undefined, + isLeft: boolean | undefined, action: any, i18n: LocalizerType ): JSX.Element | null { - if (showDeleteContact(Boolean(isMe), Boolean(isGroup), Boolean(isPublic))) { + if ( + showDeleteContact( + Boolean(isMe), + Boolean(isGroup), + Boolean(isPublic), + Boolean(isLeft) + ) + ) { if (isPublic) { return {i18n('leaveGroup')}; }