From 846f39654541c05949c85632e86f3d63a5c3da5c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 1 Feb 2021 17:07:44 +1100 Subject: [PATCH] show Delete conversation menu when we got removed from the group too --- ts/components/session/menu/ConversationHeaderMenu.tsx | 1 + .../session/menu/ConversationListItemContextMenu.tsx | 1 + ts/components/session/menu/Menu.tsx | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ts/components/session/menu/ConversationHeaderMenu.tsx b/ts/components/session/menu/ConversationHeaderMenu.tsx index f0a0454a9..9dcd0a37e 100644 --- a/ts/components/session/menu/ConversationHeaderMenu.tsx +++ b/ts/components/session/menu/ConversationHeaderMenu.tsx @@ -126,6 +126,7 @@ export const ConversationHeaderMenu = (props: PropsConversationHeaderMenu) => { isGroup, isPublic, left, + isKickedFromGroup, onDeleteContact, window.i18n )} diff --git a/ts/components/session/menu/ConversationListItemContextMenu.tsx b/ts/components/session/menu/ConversationListItemContextMenu.tsx index 5d0ea6ff2..7c3eadfb5 100644 --- a/ts/components/session/menu/ConversationListItemContextMenu.tsx +++ b/ts/components/session/menu/ConversationListItemContextMenu.tsx @@ -93,6 +93,7 @@ export const ConversationListItemContextMenu = ( type === 'group', isPublic, left, + isKickedFromGroup, onDeleteContact, window.i18n )} diff --git a/ts/components/session/menu/Menu.tsx b/ts/components/session/menu/Menu.tsx index bb0be3d15..25b83ae7d 100644 --- a/ts/components/session/menu/Menu.tsx +++ b/ts/components/session/menu/Menu.tsx @@ -40,10 +40,11 @@ function showDeleteContact( isMe: boolean, isGroup: boolean, isPublic: boolean, - isGroupLeft: boolean + isGroupLeft: boolean, + isKickedFromGroup: boolean ): boolean { // you need to have left a closed group first to be able to delete it completely. - return (!isMe && !isGroup) || (isGroup && isGroupLeft); + return (!isMe && !isGroup) || (isGroup && (isGroupLeft || isKickedFromGroup)); } function showAddModerators( @@ -100,6 +101,7 @@ export function getDeleteContactMenuItem( isGroup: boolean | undefined, isPublic: boolean | undefined, isLeft: boolean | undefined, + isKickedFromGroup: boolean | undefined, action: any, i18n: LocalizerType ): JSX.Element | null { @@ -108,7 +110,8 @@ export function getDeleteContactMenuItem( Boolean(isMe), Boolean(isGroup), Boolean(isPublic), - Boolean(isLeft) + Boolean(isLeft), + Boolean(isKickedFromGroup) ) ) { if (isPublic) {