Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceywasabi committed Dec 6, 2024
1 parent 9091ba8 commit da96fd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion js/esptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ class EspLoader {
return value["chipId"]
}
}
throw("Unable to detect Chip. If you are using a v1 Programmer please use the Python Flasher for now!");
this.logMsg("Detection failed and WebFlasher cannot continue.");
throw("Unable to detect OMG Device. If you are using a v1 Programmer from 2020 (lacks USB-C) please use the <a href='github.com/O-MG/O.MG-Firmware/wiki#setup---advanced-method'>Python Flasher</a> for now! <br> Otherwise, click the Help button below for common fixes & refresh this page to attempt flashing again.");
}

/**
Expand Down
15 changes: 7 additions & 8 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ async function disconnect() {
async function setStatusAlert(message, status = "success") {
let constructedStatus = "alert-" + status;
statusAlertBox.classList.add(constructedStatus);
if(message.includes("</a>")){
if(message.includes("</a>")||message.includes("<br>")){
statusAlertBox.innerHTML = message;
} else {
statusAlertBox.innerText = message;
Expand Down Expand Up @@ -1511,12 +1511,10 @@ function toggleUIHardware(ready) {
function toggleUIConnected(connected, msg = "") {
let lbl = "Connect";
let message = "Cannot connect to O.MG Device.";
if(msg!=""){
if(msg instanceof DOMException){
message = msg.message.replace(/^[^:]*:/, '').trim();
} else {
message = msg.replace(/^[^:]*:/, '').trim();
}
if (msg instanceof DOMException) {
message = msg.message.replace(/^[^:]*:/, '').trim();
} else if (typeof msg === "string") {
message = msg.replace(/^[^:]*:/, '').trim();
}
if (connected) {
butProgram.disabled = false;
Expand All @@ -1531,7 +1529,8 @@ function toggleUIConnected(connected, msg = "") {
//butProgram.disabled = true;
lbl = "Error";
sdstat("error","hardware-missing");
let err = `${message} Click the Help button below for common fixes. Then refresh this page to attempt flashing again.`;
let err = `${message}`
// Click the Help button below for common fixes. Then refresh this page to attempt flashing again.`;
setStatusAlert(err, "danger");
accordionExpand(2);
accordionDisable();
Expand Down

0 comments on commit da96fd5

Please sign in to comment.