yep this seems to work, i'm just an inobservant moron

This commit is contained in:
tim h 2023-01-08 10:11:33 -06:00
parent 1ff5d7b8e4
commit c8cafe36b0

View file

@ -460,24 +460,20 @@ async function testHostConnection() {
// Checks every 5 seconds if offline, 60 seconds if online
const checkAgain = () => {
checkFocus();
if (focused || firstTimeOnline) {
setTimeout(
async () => {
let simple = !firstTimeOnline;
await checkConnection(false, simple);
checkFocus();
checkAgain();
},
connectionStatus ? 60000 : 5000
// connectionStatus ? 10000 : 1000 //TODO REMOVE DEBUG REPLACE TO 60000 : 5000
);
} else {
setTimeout(() => {
console.debug("unfocused, zzz");
checkFocus();
checkAgain();
}, 60000);
// }, 1000); //TODO REMOVE DEBUG REPLACE TO 60000
}
};
@ -1294,12 +1290,10 @@ document.addEventListener("visibilitychange", () => {
window.addEventListener("blur", () => {
checkFocus();
console.warn("openoutpaint unfocused");
});
window.addEventListener("focus", () => {
checkFocus();
console.warn("openoutpaint focused");
});
function checkFocus() {
@ -1309,5 +1303,4 @@ function checkFocus() {
} else {
focused = true;
}
console.debug("FOCUSED: " + focused); //TODO comment out or something //seriously it stops working without this here wtf
}