diff --git a/www/js/location.js b/www/js/location.js index fd4f944..69f1b5f 100644 --- a/www/js/location.js +++ b/www/js/location.js @@ -201,11 +201,11 @@ function pingServer() { if (lockGot && gpsaccuracy < requiredaccuracy) { $.getJSON(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude, function (data) { if (data.status == "ERROR") { - navigator.notification.alert("Your account status has changed, and you have been logged out. Reason: " + data.message, "Account Status Changed", "OK"); - localStorage.setItem("no_autologin", true); + localStorage.setItem("no_autologin", "true"); username = null; password = null; - openscreen('login'); + document.location.href = "index.html"; + navigator.notification.alert("Your session status has changed, and you have been logged out. \n\nReason: " + data.message, null, "Sign-in Status Changed", "OK"); } }); } @@ -240,4 +240,13 @@ setInterval(pingServer, 5000); // Show error if it's taking too long setTimeout(function () { onError(); -}, 15 * 1000); \ No newline at end of file +}, 15 * 1000); + +setTimeout(function () { + // GPS lock is taking too long, let's GTFO of the loading screen + $('#loading').fadeOut('slow', function () { + $('#no-lock').css('display', 'block'); + $('#loading').css('display', 'none'); + updateStatusBarColor(); + }); +}, 30 * 1000); \ No newline at end of file diff --git a/www/screens/login.html b/www/screens/login.html index 1e8efdf..1d54a2e 100644 --- a/www/screens/login.html +++ b/www/screens/login.html @@ -108,7 +108,7 @@ passset = true; } - if (userset && passset && localStorage.getItem("no_autologin") !== true) { + if (userset && passset && localStorage.getItem("no_autologin") !== "true") { // Try to login with stored credentials $.post("https://sso.netsyms.com/api/simpleauth.php", {user: localStorage.getItem("username"), pass: localStorage.getItem("password")}, @@ -126,7 +126,7 @@ } else { $('#loading').css('display', 'none'); // Remove autologin block - localStorage.setItem("no_autologin", false); + localStorage.setItem("no_autologin", ""); updateStatusBarColor(); } navigator.splashscreen.hide();