diff --git a/ts/components/conversation/MessageContextMenu.tsx b/ts/components/conversation/MessageContextMenu.tsx
index a38ba3008..a1ad0402b 100644
--- a/ts/components/conversation/MessageContextMenu.tsx
+++ b/ts/components/conversation/MessageContextMenu.tsx
@@ -169,7 +169,9 @@ export const MessageContextMenu = (props: PropsForMessageContextMenu) => {
>
) : null}
{weAreAdmin && isPublic ? - {window.i18n('banUser')}
: null}
- {weAreAdmin && isPublic ? - {window.i18n('banUserAndDeleteAll')}
: null}
+ {weAreAdmin && isPublic ? (
+ - {window.i18n('banUserAndDeleteAll')}
+ ) : null}
{weAreAdmin && isOpenGroupV2 ? (
- {window.i18n('unbanUser')}
) : null}
diff --git a/ts/interactions/messageInteractions.ts b/ts/interactions/messageInteractions.ts
index c86956852..ffbe08806 100644
--- a/ts/interactions/messageInteractions.ts
+++ b/ts/interactions/messageInteractions.ts
@@ -10,7 +10,11 @@ import { ToastUtils } from '../session/utils';
import { updateConfirmModal } from '../state/ducks/modalDialog';
-export function banUser(userToBan: string, conversationId: string, deleteAllMessages: boolean = false) {
+export function banUser(
+ userToBan: string,
+ conversationId: string,
+ deleteAllMessages: boolean = false
+) {
let pubKeyToBan: PubKey;
try {
pubKeyToBan = PubKey.cast(userToBan);
@@ -24,8 +28,10 @@ export function banUser(userToBan: string, conversationId: string, deleteAllMess
window.inboxStore?.dispatch(updateConfirmModal(null));
};
- const title = (deleteAllMessages) ? window.i18n('banUserAndDeleteAll') : window.i18n('banUser');
- const message = (deleteAllMessages) ? window.i18n('banUserAndDeleteAllConfirm') : window.i18n('banUserConfirm');
+ const title = deleteAllMessages ? window.i18n('banUserAndDeleteAll') : window.i18n('banUser');
+ const message = deleteAllMessages
+ ? window.i18n('banUserAndDeleteAllConfirm')
+ : window.i18n('banUserConfirm');
const confirmationModalProps = {
title: title,
@@ -43,7 +49,11 @@ export function banUser(userToBan: string, conversationId: string, deleteAllMess
if (!roomInfos) {
window.log.warn('banUser room not found');
} else {
- success = await ApiV2.banUser(pubKeyToBan, _.pick(roomInfos, 'serverUrl', 'roomId'), deleteAllMessages);
+ success = await ApiV2.banUser(
+ pubKeyToBan,
+ _.pick(roomInfos, 'serverUrl', 'roomId'),
+ deleteAllMessages
+ );
}
} else {
throw new Error('V1 opengroup are not supported');
diff --git a/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts b/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts
index 0584a13fb..95677c7cb 100644
--- a/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts
+++ b/ts/opengroup/opengroupV2/OpenGroupAPIV2.ts
@@ -268,7 +268,7 @@ export const banUser = async (
deleteAllMessages: boolean
): Promise => {
const queryParams = { public_key: userToBan.key };
- const endPoint = (deleteAllMessages) ? 'ban_and_delete_all' : 'block_list';
+ const endPoint = deleteAllMessages ? 'ban_and_delete_all' : 'block_list';
const request: OpenGroupV2Request = {
method: 'POST',
room: roomInfos.roomId,