ソースを参照

Add client side validation to prevent the user from sharing the album with themselves

Vishnu Mohandas 4 年 前
コミット
b8a627a1a3
1 ファイル変更5 行追加1 行削除
  1. 5 1
      lib/ui/share_folder_widget.dart

+ 5 - 1
lib/ui/share_folder_widget.dart

@@ -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...");