Add client side validation to prevent the user from sharing the album with themselves
This commit is contained in:
parent
0b407ef98d
commit
b8a627a1a3
1 changed files with 5 additions and 1 deletions
|
@ -147,7 +147,11 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
Future<void> _addEmailToCollection(BuildContext context) async {
|
||||
if (!isValidEmail(_email)) {
|
||||
showErrorDialog(context, "Invalid email address",
|
||||
"Please enter a valid email address");
|
||||
"Please enter a valid email address.");
|
||||
return;
|
||||
} else if (_email == Configuration.instance.getEmail()) {
|
||||
showErrorDialog(
|
||||
context, "Oops", "You cannot share the album with yourself.");
|
||||
return;
|
||||
}
|
||||
final dialog = createProgressDialog(context, "Searching for user...");
|
||||
|
|
Loading…
Add table
Reference in a new issue