mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-05-19 10:32:56 +00:00
Merge branch 'main' into warnings-fix
This commit is contained in:
commit
3ecc9e33c0
2 changed files with 14 additions and 12 deletions
|
@ -7,8 +7,8 @@ const refreshIcon = refreshButton.querySelector("img");
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
|
|
||||||
refreshButton.addEventListener("click", async () => {
|
refreshButton.addEventListener("click", async () => {
|
||||||
// check if interface is connected via WiFi
|
// check if interface is in WiFi-AccessPoint mode
|
||||||
if (data.connection == 0 || data.connection == 1) {
|
if (data.connection == 1) {
|
||||||
alert(
|
alert(
|
||||||
"Beim WLAN-Scan wird die Verbindung hardwarebedingt kurzzeitig" +
|
"Beim WLAN-Scan wird die Verbindung hardwarebedingt kurzzeitig" +
|
||||||
"unterbrochen.\n" +
|
"unterbrochen.\n" +
|
||||||
|
|
|
@ -55,18 +55,20 @@ export async function updateConfig(fetchOptions) {
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
throw new Error(`Response status: ${res.status}`);
|
throw new Error(`Response status: ${res.status}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait for the esp to restart
|
|
||||||
const delay = new Promise((resolve) =>
|
|
||||||
setTimeout(() => resolve(), 500)
|
|
||||||
);
|
|
||||||
await delay;
|
|
||||||
|
|
||||||
const data = await loadData(30 * 1000);
|
|
||||||
writeDataToInput(data);
|
|
||||||
hideLoadingScreen();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
showError(error.message);
|
showError(error.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < 10; i++) {
|
||||||
|
try {
|
||||||
|
const data = await loadData(5000);
|
||||||
|
writeDataToInput(data);
|
||||||
|
hideLoadingScreen();
|
||||||
|
|
||||||
|
break;
|
||||||
|
} catch (error) {
|
||||||
|
// retry loading config until successful
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue