Skip to content

Commit bc13c80

Browse files
committed
Attempt to fix disconnect button state desync.
1 parent 28ded62 commit bc13c80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/device/webusb_serial/website/application.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,15 @@
304304

305305
async disconnectPort() {
306306
this.stopAutoReconnect();
307-
if (!this.currentPort) return;
307+
308+
if (!this.currentPort) {
309+
this.updateUIConnectionState();
310+
return;
311+
};
308312

309313
try {
310314
await this.currentPort.disconnect();
315+
this.setStatus('Disconnected', 'info');
311316
}
312317
catch (error) {
313318
this.setStatus(`Disconnect error: ${error.message}`, 'error');

0 commit comments

Comments
 (0)