|
@@ -21,6 +21,7 @@ namespace comal.timesheets
|
|
|
bool twoFAvisible = false;
|
|
|
bool checkingClipBoard = false;
|
|
|
string loadFromIOSLink = "";
|
|
|
+ bool timerRunning = false;
|
|
|
Timer timer;
|
|
|
public PINLoginPage(string logindetails = "")
|
|
|
{
|
|
@@ -33,7 +34,7 @@ namespace comal.timesheets
|
|
|
|
|
|
|
|
|
|
|
|
- protected override async void OnAppearing()
|
|
|
+ protected override void OnAppearing()
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -46,7 +47,7 @@ namespace comal.timesheets
|
|
|
if (!string.IsNullOrWhiteSpace(GlobalVariables.LoadFromLinkString))
|
|
|
{
|
|
|
if (GlobalVariables.LoadFromLinkString == "Link has expired")
|
|
|
- await DisplayAlert("Alert", "Link has expired", "OK");
|
|
|
+ DisplayAlert("Alert", "Link has expired", "OK");
|
|
|
}
|
|
|
|
|
|
if (!GlobalVariables.InternalOnAppearing)
|
|
@@ -77,14 +78,14 @@ namespace comal.timesheets
|
|
|
Thread.Sleep(250);
|
|
|
Device.BeginInvokeOnMainThread(() =>
|
|
|
{
|
|
|
- if (App.IsUserLoggedIn && GlobalVariables.ChangeUser == false)
|
|
|
- {
|
|
|
- LaunchMainPage();
|
|
|
- return;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (String.IsNullOrWhiteSpace(App.Settings.UserID) || String.IsNullOrWhiteSpace(App.Settings.Password))
|
|
|
+ if (App.IsUserLoggedIn && GlobalVariables.ChangeUser == false)
|
|
|
+ {
|
|
|
+ LaunchMainPage();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (String.IsNullOrWhiteSpace(App.Settings.UserID) || String.IsNullOrWhiteSpace(App.Settings.Password))
|
|
|
{
|
|
|
DisplayAlert("Unable to log in", "User ID or password is blank", "OK");
|
|
|
ShowPINPad();
|
|
@@ -167,8 +168,8 @@ namespace comal.timesheets
|
|
|
App.Current.Properties.Add("SessionID", ClientFactory.SessionID);
|
|
|
else
|
|
|
App.Current.Properties["SessionID"] = ClientFactory.SessionID;
|
|
|
- timer = new Timer(Callback, null, Timeout.Infinite, 5000);
|
|
|
- timer.Dispose();
|
|
|
+ if(timerRunning)
|
|
|
+ timer.Dispose();
|
|
|
App.Data.Refresh(true);
|
|
|
Device.BeginInvokeOnMainThread(async () => { await Navigation.PushAsync(new MainPage()); });
|
|
|
}
|
|
@@ -209,6 +210,7 @@ namespace comal.timesheets
|
|
|
try
|
|
|
{
|
|
|
timer = new Timer(Callback, null, 4000, 500);
|
|
|
+ timerRunning = true;
|
|
|
}
|
|
|
catch
|
|
|
{ }
|