From 0e5ca3f731c859e946a7bc5a77cb8c0518149c47 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 12 Jul 2023 13:41:49 +0200 Subject: [PATCH] chore: remove the unblockGroupToSend string as we cannot block a group. --- _locales/en/messages.json | 1 - .../conversation/composition/CompositionBox.tsx | 13 +++---------- ts/session/utils/Toast.tsx | 4 ---- ts/types/LocalizerKeys.ts | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index e79bc63df0..e560f146e8 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -181,7 +181,6 @@ "messageBodyMissing": "Please enter a message body.", "messageBody": "Message body", "unblockToSend": "Unblock this contact to send a message.", - "unblockGroupToSend": "This group is blocked. Unlock it if you would like to send a message.", "youChangedTheTimer": "You set the disappearing message timer to $time$", "timerSetOnSync": "Updated disappearing message timer to $time$", "theyChangedTheTimer": "$name$ set the disappearing message timer to $time$", diff --git a/ts/components/conversation/composition/CompositionBox.tsx b/ts/components/conversation/composition/CompositionBox.tsx index da63b9c060..e7ea8aa2cf 100644 --- a/ts/components/conversation/composition/CompositionBox.tsx +++ b/ts/components/conversation/composition/CompositionBox.tsx @@ -472,16 +472,13 @@ class CompositionBoxInner extends React.Component { if (left) { return i18n('youLeftTheGroup'); } - if (isBlocked && isPrivate) { + if (isBlocked) { return i18n('unblockToSend'); } - if (isBlocked && !isPrivate) { - return i18n('unblockGroupToSend'); - } return i18n('sendMessage'); }; - const { isKickedFromGroup, left, isPrivate, isBlocked } = this.props.selectedConversation; + const { isKickedFromGroup, left, isBlocked } = this.props.selectedConversation; const messagePlaceHolder = makeMessagePlaceHolderText(); const { typingEnabled } = this.props; const neverMatchingRegex = /($a)/; @@ -858,14 +855,10 @@ class CompositionBoxInner extends React.Component { return; } - if (selectedConversation.isBlocked && selectedConversation.isPrivate) { + if (selectedConversation.isBlocked) { ToastUtils.pushUnblockToSend(); return; } - if (selectedConversation.isBlocked && !selectedConversation.isPrivate) { - ToastUtils.pushUnblockToSendGroup(); - return; - } // Verify message length const msgLen = messagePlaintext?.length || 0; if (msgLen === 0 && this.props.stagedAttachments?.length === 0) { diff --git a/ts/session/utils/Toast.tsx b/ts/session/utils/Toast.tsx index 0de25cbaaa..1087345edd 100644 --- a/ts/session/utils/Toast.tsx +++ b/ts/session/utils/Toast.tsx @@ -201,10 +201,6 @@ export function pushUnblockToSend() { pushToastInfo('unblockToSend', window.i18n('unblockToSend')); } -export function pushUnblockToSendGroup() { - pushToastInfo('unblockGroupToSend', window.i18n('unblockGroupToSend')); -} - export function pushYouLeftTheGroup() { pushToastError('youLeftTheGroup', window.i18n('youLeftTheGroup')); } diff --git a/ts/types/LocalizerKeys.ts b/ts/types/LocalizerKeys.ts index d7a9cb14b5..eb2123ccea 100644 --- a/ts/types/LocalizerKeys.ts +++ b/ts/types/LocalizerKeys.ts @@ -181,7 +181,6 @@ export type LocalizerKeys = | 'messageBodyMissing' | 'messageBody' | 'unblockToSend' - | 'unblockGroupToSend' | 'youChangedTheTimer' | 'timerSetOnSync' | 'theyChangedTheTimer'