ソースを参照

Change OTT copy for forgot password

Neeraj Gupta 1 年間 前
コミット
0ebd1d1b67

+ 2 - 0
lib/generated/intl/messages_en.dart

@@ -1220,6 +1220,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "time": MessageLookupByLibrary.simpleMessage("Time"),
         "toHideAPhotoOrVideo":
             MessageLookupByLibrary.simpleMessage("To hide a photo or video"),
+        "toResetVerifyEmail": MessageLookupByLibrary.simpleMessage(
+            "To reset your password, please verify your email first."),
         "todaysLogs": MessageLookupByLibrary.simpleMessage("Today\'s logs"),
         "total": MessageLookupByLibrary.simpleMessage("total"),
         "totalSize": MessageLookupByLibrary.simpleMessage("Total size"),

+ 10 - 0
lib/generated/l10n.dart

@@ -7414,6 +7414,16 @@ class S {
       args: [],
     );
   }
+
+  /// `To reset your password, please verify your email first.`
+  String get toResetVerifyEmail {
+    return Intl.message(
+      'To reset your password, please verify your email first.',
+      name: 'toResetVerifyEmail',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 2 - 1
lib/l10n/intl_en.arb

@@ -1083,5 +1083,6 @@
   "zoomOutToSeePhotos": "Zoom out to see photos",
   "noImagesWithLocation": "No images with location",
   "unpinAlbum": "Unpin album",
-  "pinAlbum": "Pin album"
+  "pinAlbum": "Pin album",
+  "toResetVerifyEmail": "To reset your password, please verify your email first."
 }

+ 2 - 0
lib/services/user_service.dart

@@ -84,6 +84,7 @@ class UserService {
     String email, {
     bool isChangeEmail = false,
     bool isCreateAccountScreen = false,
+    bool isResetPasswordScreen = false,
   }) async {
     final dialog = createProgressDialog(context, S.of(context).pleaseWait);
     await dialog.show();
@@ -102,6 +103,7 @@ class UserService {
                   email,
                   isChangeEmail: isChangeEmail,
                   isCreateAccountScreen: isCreateAccountScreen,
+                  isResetPasswordScreen: isResetPasswordScreen,
                 );
               },
             ),

+ 4 - 10
lib/ui/account/login_pwd_verification_page.dart

@@ -8,7 +8,6 @@ import "package:photos/services/user_service.dart";
 import "package:photos/theme/ente_theme.dart";
 import 'package:photos/ui/common/dynamic_fab.dart';
 import "package:photos/utils/dialog_util.dart";
-import "package:photos/utils/toast_util.dart";
 
 // LoginPasswordVerificationPage is a page that allows the user to enter their password to verify their identity.
 // If the password is correct, then the user is either directed to
@@ -176,15 +175,10 @@ State<LoginPasswordVerificationPage> {
                     children: [
                       GestureDetector(
                         behavior: HitTestBehavior.opaque,
-                        onTap: () {
-                          showToast(context, "Trigger ott verification");
-                          // Navigator.of(context).push(
-                          //   MaterialPageRoute(
-                          //     builder: (BuildContext context) {
-                          //       return const RecoveryPage();
-                          //     },
-                          //   ),
-                          // );
+                        onTap: () async {
+                          await UserService.instance
+                              .sendOtt(context, email!,
+                              isResetPasswordScreen: true,);
                         },
                         child: Center(
                           child: Text(

+ 12 - 0
lib/ui/account/ott_verification_page.dart

@@ -10,11 +10,13 @@ class OTTVerificationPage extends StatefulWidget {
   final String email;
   final bool isChangeEmail;
   final bool isCreateAccountScreen;
+  final bool isResetPasswordScreen;
 
   const OTTVerificationPage(
     this.email, {
     this.isChangeEmail = false,
     this.isCreateAccountScreen = false,
+        this.isResetPasswordScreen = false,
     Key? key,
   }) : super(key: key);
 
@@ -127,6 +129,14 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                             },
                           ),
                         ),
+                        if(widget.isResetPasswordScreen)
+                          Text(
+                            S.of(context).toResetVerifyEmail,
+                            style: Theme.of(context)
+                                .textTheme
+                                .titleMedium!
+                                .copyWith(fontSize: 14),
+                          ),
                         Text(
                           S.of(context).checkInboxAndSpamFolder,
                           style: Theme.of(context)
@@ -181,6 +191,8 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                         context,
                         widget.email,
                         isCreateAccountScreen: widget.isCreateAccountScreen,
+                        isResetPasswordScreen: widget.isResetPasswordScreen,
+                        isChangeEmail: widget.isChangeEmail,
                       );
                     },
                     child: Text(