2
2
mirror of https://git.coolaj86.com/coolaj86/telebit.js.git synced 2025-03-02 22:50:41 +00:00

async transitions, but don't delay

This commit is contained in:
AJ ONeal 2018-10-23 13:03:36 -06:00
parent 2679a20d1c
commit 08c18b8c94

View File

@ -260,9 +260,8 @@ var appStates = {
appData.views.section = { otp: true };
}
, status: function () {
appData.views.section = { status: true };
var tok = setInterval(function () {
api.status().then(function (status) {
function updateStatus() {
return api.status().then(function (status) {
var wilddomains = [];
var rootdomains = [];
var subdomains = [];
@ -294,11 +293,15 @@ var appStates = {
appData.newHttp.name = (appData.status.wildDomains[0] || {}).name;
appData.state.ssh = (appData.status.ssh > 0) && appData.status.ssh || undefined;
});
}, 2000);
}
var tok = setInterval(updateStatus, 2000);
return function cancelState() {
clearInterval(tok);
};
return updateStatus().then(function () {
appData.views.section = { status: true };
return function cancelState() {
clearInterval(tok);
};
});
}
};