From b4f1afe720d8afeda01799f7d122d0124812c7e7 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 17 Feb 2020 11:09:09 +1100 Subject: [PATCH] do not add new members if closed group size >= 10 --- _locales/en/messages.json | 12 +++++++++--- js/views/invite_friends_dialog_view.js | 6 ++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1a33c77a6..5ee80af32 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2488,9 +2488,6 @@ "message": "Profile name cannot be empty", "description": "Error message displayed on empty profile name" }, - "maxGroupMembersError": { - "message": "Max number of members for small group chats is: " - }, "nonAdminDeleteMember": { "message": "Only group admin can remove members!" }, @@ -2819,5 +2816,14 @@ "example": "10" } } + }, + "maxGroupMembersError": { + "message": "Max number of members for small group chats is $maxSize$", + "placeholders": { + "maxSize": { + "content": "$1", + "example": "10" + } + } } } diff --git a/js/views/invite_friends_dialog_view.js b/js/views/invite_friends_dialog_view.js index 09ab91d81..1cc7c0ec0 100644 --- a/js/views/invite_friends_dialog_view.js +++ b/js/views/invite_friends_dialog_view.js @@ -72,11 +72,9 @@ // Do not trigger an update if there is too many members if ( newMembers.length + existingMembers.length > - window.SMALL_GROUP_SIZE_LIMIT + window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT ) { - const msg = `${window.i18n('maxGroupMembersError')} ${ - window.SMALL_GROUP_SIZE_LIMIT - }`; + const msg = window.i18n('maxGroupMembersError', window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT); window.pushToast({ title: msg,