Quellcode durchsuchen

PRS MOBILE - error logging / retries for 2FA on PIN page

Nick-PRSDigital@bitbucket.org vor 2 Jahren
Ursprung
Commit
9134b59264
1 geänderte Dateien mit 19 neuen und 6 gelöschten Zeilen
  1. 19 6
      prs.mobile/comal.timesheets/Main/PINLoginPage.xaml.cs

+ 19 - 6
prs.mobile/comal.timesheets/Main/PINLoginPage.xaml.cs

@@ -643,6 +643,7 @@ namespace comal.timesheets
                 {
                     using (await MaterialDialog.Instance.LoadingDialogAsync(message: "Checking"))
                     {
+                        string fullstring = "";
                         try
                         {
                             string s0 = ent0.Text;
@@ -652,23 +653,35 @@ namespace comal.timesheets
                             string s4 = ent4.Text;
                             string s5 = ent5.Text;
 
-                            string fullstring = s0 + s1 + s2 + s3 + s4 + s5;
+                            fullstring = s0 + s1 + s2 + s3 + s4 + s5;
                             Device.BeginInvokeOnMainThread(() => { clearBtn.Focus(); });
 
-                            bool check2FA = ClientFactory.Check2FA(fullstring);
-                            if (check2FA)
-                                Device.BeginInvokeOnMainThread(() => { LaunchMainPage(); });
-                            else
-                                return;
+                            Check2FAString(fullstring);
                         }
                         catch (Exception ex)
                         {
+                            var log = new MobileLogging(LogType.BackgroundProcess, "CheckEntries()", ex.Message, this.GetType().Name);
                             DisplayAlert("Error with 2FA", ex.Message, "OK");
                         }
                     }
                 });
             });
         }
+
+        private void Check2FAString(string fullstring)
+        {
+            try
+            {
+                bool check2FA = ClientFactory.Check2FA(fullstring);
+                if (check2FA)
+                    Device.BeginInvokeOnMainThread(() => { LaunchMainPage(); });
+            }
+            catch (Exception ex)
+            {
+                var log = new MobileLogging(LogType.BackgroundProcess, "Check2FAString()", ex.Message, this.GetType().Name);
+                Check2FAString(fullstring);
+            }
+        }
         #endregion
 
         private void CheckForLatestVersion()