mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
feat(share-to-multi-contacts-at-once): change data structure of selected emails from List to Set to avoid duplicates
This commit is contained in:
parent
487be4a451
commit
a4985116b8
@ -30,7 +30,7 @@ class AddParticipantPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AddParticipantPage extends State<AddParticipantPage> {
|
||||
final _selectedEmails = <String>[];
|
||||
final _selectedEmails = <String>{};
|
||||
String selectedEmail = '';
|
||||
String _email = '';
|
||||
bool isEmailListEmpty = false;
|
||||
@ -332,11 +332,14 @@ class _AddParticipantPage extends State<AddParticipantPage> {
|
||||
for (var suggestedUser in _suggestedUsers) {
|
||||
if (suggestedUser.email == _email) {
|
||||
_selectedEmails.add(suggestedUser.email);
|
||||
clearFocus();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
_suggestedUsers.insert(0, User(email: _email));
|
||||
_selectedEmails.add(_email);
|
||||
clearFocus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user