From 396536522a896b65a42de5c27d7f028d2f11558f Mon Sep 17 00:00:00 2001 From: Nic Limper Date: Mon, 29 May 2023 23:52:30 +0200 Subject: [PATCH] small ota bugfix --- ESP32_AP-Flasher/data/www/ota.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ESP32_AP-Flasher/data/www/ota.js b/ESP32_AP-Flasher/data/www/ota.js index a9c95c69..e01c9a30 100644 --- a/ESP32_AP-Flasher/data/www/ota.js +++ b/ESP32_AP-Flasher/data/www/ota.js @@ -81,7 +81,7 @@ export async function initUpdate() { easyupdate.innerHTML = ("No releases found."); } else { const release = releaseDetails[0]; - if (release.tag_name) { + if (release && release.tag_name) { if (release.tag_name == currentVer) { easyupdate.innerHTML = `Version ${currentVer}. You are up to date`; } else if (release.date < formatEpoch(currentBuildtime)) { @@ -213,7 +213,6 @@ export async function updateWebpage(fileUrl, tagname, showReload) { } export async function updateESP(fileUrl, showConfirm) { - print(running); if (running) return; if (showConfirm) { if (!confirm("Confirm updating the esp32")) return; @@ -300,7 +299,7 @@ export function print(line, color = "white") { const newLine = document.createElement('div'); newLine.style.color = color; if (line == "[reboot]") { - newLine.innerHTML = ""; + newLine.innerHTML = ""; } else { newLine.textContent = line; } @@ -311,7 +310,7 @@ export function print(line, color = "white") { } } -function reboot() { +export function reboot() { print("Rebooting now... Reloading webpagina in 5 seconds...", "yellow"); fetch("/reboot",{method: "POST"}); setTimeout(() => {