mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 12:16:47 +00:00
add group limit size
This commit is contained in:
parent
f24d91e313
commit
e824f4cd87
6 changed files with 31 additions and 1 deletions
|
|
@ -2931,6 +2931,12 @@ abstract class AppLocalizations {
|
|||
/// In en, this message translates to:
|
||||
/// **'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.'**
|
||||
String get deleteUserErrorMessage;
|
||||
|
||||
/// No description provided for @groupSizeLimitError.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Currently, group size is limited to {size} people!'**
|
||||
String groupSizeLimitError(Object size);
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
|
|
|||
|
|
@ -1631,4 +1631,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get deleteUserErrorMessage =>
|
||||
'Du kannst den Kontakt erst löschen, wenn der direkte Chat gelöscht wurde und der Kontakt nicht mehr Mitglied einer Gruppe ist.';
|
||||
|
||||
@override
|
||||
String groupSizeLimitError(Object size) {
|
||||
return 'Derzeit ist die Gruppengröße auf $size Personen begrenzt!';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1619,4 +1619,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get deleteUserErrorMessage =>
|
||||
'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.';
|
||||
|
||||
@override
|
||||
String groupSizeLimitError(Object size) {
|
||||
return 'Currently, group size is limited to $size people!';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1619,4 +1619,9 @@ class AppLocalizationsSv extends AppLocalizations {
|
|||
@override
|
||||
String get deleteUserErrorMessage =>
|
||||
'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.';
|
||||
|
||||
@override
|
||||
String groupSizeLimitError(Object size) {
|
||||
return 'Currently, group size is limited to $size people!';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4096b342802fc07be92070c7db6f46353790876b
|
||||
Subproject commit 471fed328ff1bf9316e9b86456ecdd68f4cfabca
|
||||
|
|
@ -84,6 +84,15 @@ class _StartNewChatView extends State<GroupCreateSelectMembersView> {
|
|||
void toggleSelectedUser(int userId) {
|
||||
if (alreadyInGroup.contains(userId)) return;
|
||||
if (!selectedUsers.contains(userId)) {
|
||||
if (selectedUsers.length + alreadyInGroup.length > 256) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(context.lang.groupSizeLimitError(256)),
|
||||
duration: const Duration(seconds: 3),
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
selectedUsers.add(userId);
|
||||
} else {
|
||||
selectedUsers.remove(userId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue