From 8f056646d99df7c21952532b9237de6be26b3c6c Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 13 Oct 2023 07:54:20 -0700 Subject: [PATCH] Back out "auto start server" Summary: Original commit changeset: 2c11e80429a2 Original Phabricator Diff: D50074673 lblasa got reports it doesn't always work (possibly permission issues) Reviewed By: lblasa Differential Revision: D50259755 fbshipit-source-id: 1cd5f92c4e6e40a06340ecfebea01b899ac1cc85 --- desktop/static/offline.html | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/desktop/static/offline.html b/desktop/static/offline.html index 18416204e..975c29049 100644 --- a/desktop/static/offline.html +++ b/desktop/static/offline.html @@ -137,6 +137,7 @@ setTimeout(() => { button.disabled = false; button.value = 'Start'; + }, 30 * 10000); } @@ -147,24 +148,18 @@ window.location.reload(); }); - let autoStarted = false; - // Check if the server is responding & reload the page if it is. // This handles the case when the device is online, but the server // is offline or misbehaving. async function checkNetworkAndReload() { try { const response = await fetch('.'); - if (response.status === 200) { + if (response.status >= 200 && response.status < 500) { window.location.reload(); return; } } catch { - // trigger submit button automatically, but only once - if (!autoStarted) { - autoStarted = true; - document.getElementById("submit").click(); - } + // Unable to connect to the server, ignore. } window.setTimeout(checkNetworkAndReload, 2500); }