diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0726088f3..8e0d86808 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -927,10 +927,6 @@ "message": "Permanently delete the messages in this conversation?", "description": "Confirmation dialog text that asks the user if they really wish to delete the conversation. Answer buttons use the strings 'ok' and 'cancel'. The deletion is permanent, i.e. it cannot be undone." }, - "leaveOpenGroupConfirmation": { - "message": "Leave this Open Group?", - "description": "Confirmation dialog text that tells the user what will happen if they leave the public channel." - }, "deleteAccount": { "message": "Delete Account", "description": "Text for button in settings view to delete account" @@ -1605,17 +1601,17 @@ "message": "Ban failed!", "description": "Toast on unsuccesful user ban." }, - "leaveOpenGroup": { - "message": "Leave Open Group", + "leaveGroup": { + "message": "Leave Group", "description": "Button action that the user can click to leave the group" }, "leaveClosedGroup": { "message": "Leave Closed Group", "description": "Button action that the user can click to leave the group" }, - "leaveClosedGroupConfirmation": { - "message": "Leave this Closed Group?", - "description": "Confirmation dialog text that tells the user what will happen if they leave the closed group." + "leaveGroupConfirmation": { + "message": "Are you sure you want to leave this group?", + "description": "Confirmation dialog text that tells the user what will happen if they leave the group." }, "noContactsForGroup": { "message": "You don't have any contacts to start a group with." diff --git a/js/models/conversations.js b/js/models/conversations.js index 6c49105fa..2f38ae439 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -2302,12 +2302,15 @@ this.contactCollection.reset(contacts); }); }, + // returns true if this is a closed/medium or open group + isGroup() { + return this.get('type') === 'group'; + }, copyPublicKey() { clipboard.writeText(this.id); - const isGroup = this.getProps().type === 'group'; - const copiedMessage = isGroup + const copiedMessage = this.isGroup() ? i18n('copiedChatId') : i18n('copiedPublicKey'); @@ -2330,12 +2333,9 @@ let title = i18n('deleteContact'); let message = i18n('deleteContactConfirmation'); - if (this.isPublic()) { - title = i18n('leaveOpenGroup'); - message = i18n('leaveOpenGroupConfirmation'); - } else if (this.isClosedGroup()) { - title = i18n('leaveClosedGroup'); - message = i18n('leaveClosedGroupConfirmation'); + if (this.isGroup()) { + title = i18n('leaveGroup'); + message = i18n('leaveGroupConfirmation'); } window.confirmationDialog({ diff --git a/js/views/app_view.js b/js/views/app_view.js index 3bfbe282a..046a5c40e 100644 --- a/js/views/app_view.js +++ b/js/views/app_view.js @@ -237,12 +237,9 @@ let title = i18n('deleteContact'); let message = i18n('deleteContactConfirmation'); - if (groupConvo.isPublic()) { - title = i18n('leaveOpenGroup'); - message = i18n('leaveOpenGroupConfirmation'); - } else if (groupConvo.isClosedGroup()) { - title = i18n('leaveClosedGroup'); - message = i18n('leaveClosedGroupConfirmation'); + if (groupConvo.isGroup()) { + title = i18n('leaveGroup'); + message = i18n('leaveGroupConfirmation'); } window.confirmationDialog({ diff --git a/ts/components/session/SessionGroupSettings.tsx b/ts/components/session/SessionGroupSettings.tsx index c7e64f8eb..d028563de 100644 --- a/ts/components/session/SessionGroupSettings.tsx +++ b/ts/components/session/SessionGroupSettings.tsx @@ -223,10 +223,10 @@ export class SessionGroupSettings extends React.Component { const hasDisappearingMessages = !isPublic && !isKickedFromGroup && !isBlocked; const leaveGroupString = isPublic - ? window.i18n('leaveOpenGroup') + ? window.i18n('leaveGroup') : isKickedFromGroup ? window.i18n('youGotKickedFromGroup') - : window.i18n('leaveClosedGroup'); + : window.i18n('leaveGroup'); const disappearingMessagesOptions = timerOptions.map(option => { return { diff --git a/ts/session/utils/Menu.tsx b/ts/session/utils/Menu.tsx index 7a1c244aa..18faef424 100644 --- a/ts/session/utils/Menu.tsx +++ b/ts/session/utils/Menu.tsx @@ -135,7 +135,7 @@ export function getDeleteContactMenuItem( ) ) { if (isPublic) { - return {i18n('leaveOpenGroup')}; + return {i18n('leaveGroup')}; } return {i18n('deleteContact')}; } @@ -158,7 +158,7 @@ export function getLeaveGroupMenuItem( Boolean(isRss) ) ) { - return {i18n('leaveClosedGroup')}; + return {i18n('leaveGroup')}; } return null; }