Skip to content

Commit

Permalink
cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
przemvs committed Oct 30, 2024
1 parent c943144 commit bee4021
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
22 changes: 10 additions & 12 deletions src/script/view_model/ActionsViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,16 @@ export class ActionsViewModel {
});
};

readonly deleteConversation = (conversationEntity: Conversation): Promise<void> => {
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()),
},
});
};

Expand Down

0 comments on commit bee4021

Please sign in to comment.