summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/device/webusb_serial/website/application.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/device/webusb_serial/website/application.js b/examples/device/webusb_serial/website/application.js
index 0886f3441..5be082ca2 100644
--- a/examples/device/webusb_serial/website/application.js
+++ b/examples/device/webusb_serial/website/application.js
@@ -304,10 +304,15 @@
async disconnectPort() {
this.stopAutoReconnect();
- if (!this.currentPort) return;
+
+ if (!this.currentPort) {
+ this.updateUIConnectionState();
+ return;
+ };
try {
await this.currentPort.disconnect();
+ this.setStatus('Disconnected', 'info');
}
catch (error) {
this.setStatus(`Disconnect error: ${error.message}`, 'error');