If backend status query has failed due to unknown error code 0, set a delayed retry until success.

This commit is contained in:
NI
2019-09-13 17:03:05 +08:00
parent 659468006b
commit 25b595b5b6

View File

@@ -38,6 +38,8 @@ import * as sshctl from "./control/ssh.js";
import * as xhr from "./xhr.js"; import * as xhr from "./xhr.js";
import * as cipher from "./crypto.js"; import * as cipher from "./crypto.js";
const backendQueryRetryDelay = 2000;
const maxTimeDiff = 30000; const maxTimeDiff = 30000;
const mainTemplate = ` const mainTemplate = `
@@ -204,6 +206,12 @@ function startApp(rootEl) {
this.page = "auth"; this.page = "auth";
break; break;
case 0:
setTimeout(() => {
this.tryInitialAuth();
}, backendQueryRetryDelay);
break;
default: default:
alert("Unexpected backend query status: " + result.result); alert("Unexpected backend query status: " + result.result);
} }