mirror of
https://github.com/bilde2910/Hauk.git
synced 2026-01-23 02:24:09 +00:00
Handle expired sessions gracefully; fixes #148
This commit is contained in:
parent
5556018609
commit
bbca5862f3
1 changed files with 3 additions and 1 deletions
|
|
@ -258,7 +258,7 @@ function getJSON(url, callback, invalid) {
|
|||
if (this.readyState == 4) {
|
||||
var offlineE = document.getElementById("offline");
|
||||
var notchE = document.getElementById("notch");
|
||||
if (this.status === 200 || this.status === 404) {
|
||||
if (this.status === 200) {
|
||||
// Request successful. Reset offline state and parse the JSON.
|
||||
knownOffline = false;
|
||||
if (offlineE !== null) {
|
||||
|
|
@ -274,6 +274,8 @@ function getJSON(url, callback, invalid) {
|
|||
console.log(ex);
|
||||
invalid();
|
||||
}
|
||||
} else if (this.status === 404) {
|
||||
invalid();
|
||||
} else {
|
||||
// Requested failed; offline.
|
||||
if (!knownOffline) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue