diff --git a/assets/scripts.js b/assets/scripts.js index 6a2744d..f35b6d1 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -124,7 +124,10 @@ async function connectDevice() { // Log connection failure details await logCommunication(`Serial connection failed: ${error.message || 'Unknown error'}`, 'disconnected'); - if (openPort = 1){ + // Check for specific "No port selected" error and show user-friendly message + if (error.message && error.message.includes('No port selected by the user')) { + progressBar("100", "No device selected, please try again", "#ff6666"); + } else if (openPort === 1){ closePort(); console.log("Closing port"); alert("System is still trying to close the serial port. If this message continues to come up please refresh this page.");