From bee40217fa05696487c8410b02a95292556a9d0e Mon Sep 17 00:00:00 2001 From: Przemyslaw Jozwik Date: Wed, 30 Oct 2024 09:13:49 +0100 Subject: [PATCH] cr fixes --- .../utils/getConversationActions.ts | 2 +- src/script/view_model/ActionsViewModel.ts | 22 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts index 8814e0b0598..9b214589fd6 100644 --- a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts +++ b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts @@ -153,7 +153,7 @@ const getConversationActions = ({ { condition: !isSingleUser && isTeam && roleRepository.canDeleteGroup(conversationEntity), item: { - click: async () => actionsViewModel.deleteConversation(conversationEntity), + click: () => actionsViewModel.deleteConversation(conversationEntity), Icon: Icon.DeleteIcon, identifier: 'do-delete', label: t('conversationDetailsActionDelete'), diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index e6cb755e90f..b60cf68e6db 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -302,18 +302,16 @@ export class ActionsViewModel { }); }; - readonly deleteConversation = (conversationEntity: Conversation): Promise => { - return new Promise(() => { - PrimaryModal.show(PrimaryModal.type.CONFIRM, { - primaryAction: { - action: () => this.conversationRepository.deleteConversation(conversationEntity), - text: t('modalConversationDeleteGroupAction'), - }, - text: { - message: t('modalConversationDeleteGroupMessage'), - title: t('modalConversationDeleteGroupHeadline', conversationEntity.display_name()), - }, - }); + readonly deleteConversation = (conversationEntity: Conversation) => { + PrimaryModal.show(PrimaryModal.type.CONFIRM, { + primaryAction: { + action: () => this.conversationRepository.deleteConversation(conversationEntity), + text: t('modalConversationDeleteGroupAction'), + }, + text: { + message: t('modalConversationDeleteGroupMessage'), + title: t('modalConversationDeleteGroupHeadline', conversationEntity.display_name()), + }, }); };