hide DFU version message if bootloader is already new

pull/2711/head
Gordon Williams 2023-04-27 11:02:33 +01:00
parent c7d60250a6
commit 60948dc3f6
1 changed files with 6 additions and 2 deletions

View File

@ -15,7 +15,7 @@
<p>Your current firmware version is <span id="fw-version" style="font-weight:bold">unknown</span> and DFU is <span id="boot-version" style="font-weight:bold">unknown</span></p>
</ul>
<div id="fw-ok" style="display:none">
<p>If you have an early (KickStarter or developer) Bangle.js device and still have the old 2v10.x DFU, the Firmware Update
<p id="fw-old-bootloader-msg">If you have an early (KickStarter or developer) Bangle.js device and still have the old 2v10.x DFU, the Firmware Update
will fail with a message about the DFU version. If so, please <a href="bootloader_espruino_2v12_banglejs2.hex" class="fw-link">click here to update to DFU 2v12</a> and then click the 'Upload' button that appears.</p>
<div id="latest-firmware" style="display:none">
<p>The currently available Espruino firmware releases are:</p>
@ -104,6 +104,9 @@ function onInit(device) {
version += `(&#9888; update required)`;
}
document.getElementById("boot-version").innerHTML = version;
var versionNumber = parseFloat(version.replace(".","").replace("v","."));
if (versionNumber>=2.15)
document.getElementById("fw-old-bootloader-msg").style.display = "none";
});
}
@ -156,7 +159,8 @@ function checkForFileOnServer() {
for (var i=0;i<fwlinks.length;i++)
fwlinks[i].addEventListener("click", e => {
e.preventDefault();
downloadURL(e.target.href).then(info=>{
var href = e.target.href;
if (href) downloadURL(href).then(info=>{
document.getElementById("upload").style = ""; // show upload
});
});