Ashil Kandapath пре 2 година
родитељ
комит
26ae27baa5

+ 5 - 3
lib/ui/settings/account_section_widget.dart

@@ -42,7 +42,8 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
           onTap: () async {
             if (await LocalAuthentication().isDeviceSupported()) {
               AppLock.of(context).setEnabled(false);
-              String reason = "Please authenticate to view your recovery key";
+              const String reason =
+                  "Please authenticate to view your recovery key";
               final result = await requestAuthentication(reason);
               AppLock.of(context)
                   .setEnabled(Configuration.instance.shouldShowLockScreen());
@@ -80,7 +81,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
           onTap: () async {
             if (await LocalAuthentication().isDeviceSupported()) {
               AppLock.of(context).setEnabled(false);
-              String reason = "Please authenticate to change your email";
+              const String reason = "Please authenticate to change your email";
               final result = await requestAuthentication(reason);
               AppLock.of(context)
                   .setEnabled(Configuration.instance.shouldShowLockScreen());
@@ -109,7 +110,8 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
           onTap: () async {
             if (await LocalAuthentication().isDeviceSupported()) {
               AppLock.of(context).setEnabled(false);
-              String reason = "Please authenticate to change your password";
+              const String reason =
+                  "Please authenticate to change your password";
               final result = await requestAuthentication(reason);
               AppLock.of(context)
                   .setEnabled(Configuration.instance.shouldShowLockScreen());

+ 1 - 14
lib/ui/settings/security_section_widget.dart

@@ -83,10 +83,9 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
                       return Switch.adaptive(
                         value: snapshot.data,
                         onChanged: (value) async {
-<<<<<<< HEAD
                           if (await LocalAuthentication().isDeviceSupported()) {
                             AppLock.of(context).setEnabled(false);
-                            String reason =
+                            const String reason =
                                 "Please authenticate to configure two-factor authentication";
                             final result = await requestAuthentication(reason);
                             AppLock.of(context).setEnabled(
@@ -96,18 +95,6 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
                               showToast(context, reason);
                               return;
                             }
-=======
-                          AppLock.of(context).setEnabled(false);
-                          const String reason =
-                              "Please authenticate to configure two-factor authentication";
-                          final result = await requestAuthentication(reason);
-                          AppLock.of(context).setEnabled(
-                            Configuration.instance.shouldShowLockScreen(),
-                          );
-                          if (!result) {
-                            showToast(context, reason);
-                            return;
->>>>>>> master
                           }
                           if (value) {
                             UserService.instance.setupTwoFactor(context);