Skip to content

Commit

Permalink
Merge pull request #2820 from Bilb/chore/remove-unblock-group-string
Browse files Browse the repository at this point in the history
chore: remove the unblockGroupToSend string as we cannot block a group.
  • Loading branch information
Bilb authored Aug 1, 2023
2 parents 83c7de8 + 0e5ca3f commit b7d444e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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$",
Expand Down
13 changes: 3 additions & 10 deletions ts/components/conversation/composition/CompositionBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,13 @@ class CompositionBoxInner extends React.Component<Props, State> {
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)/;
Expand Down Expand Up @@ -858,14 +855,10 @@ class CompositionBoxInner extends React.Component<Props, State> {
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) {
Expand Down
4 changes: 0 additions & 4 deletions ts/session/utils/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
1 change: 0 additions & 1 deletion ts/types/LocalizerKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export type LocalizerKeys =
| 'messageBodyMissing'
| 'messageBody'
| 'unblockToSend'
| 'unblockGroupToSend'
| 'youChangedTheTimer'
| 'timerSetOnSync'
| 'theyChangedTheTimer'
Expand Down

0 comments on commit b7d444e

Please sign in to comment.