Skip to content

Commit ffcc069

Browse files
Fix USB: flip connected state before calling loadEditor
In USBWorkflow.onConnected, loadEditor() was being called BEFORE super.onConnected() set _connected = CONNSTATE.connected. The new post-connect Device Info dialog trigger gates on connectionStatus(), which requires _connected == connected, so the dialog never opened for USB users. Reorder so super.onConnected() (which both flips the state flag and closes the connect dialog) runs first, then loadEditor() runs with connectionStatus() true. Also drop the redundant explicit connectDialog.close() call -- super.onConnected already closes it.
1 parent 67012d6 commit ffcc069

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

js/workflows/usb.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ class USBWorkflow extends Workflow {
4545
}
4646

4747
async onConnected(e) {
48-
this.connectDialog.close();
49-
await this.loadEditor();
48+
// super.onConnected sets _connected=CONNSTATE.connected and closes
49+
// the connect dialog. Run it first so that loadEditor() (and any
50+
// other code that gates on connectionStatus()) sees us as fully
51+
// connected.
52+
await super.onConnected(e);
5053
this.debugLog("connected");
51-
super.onConnected(e);
54+
await this.loadEditor();
5255
}
5356

5457
async onDisconnected(e, reconnect = true) {

0 commit comments

Comments
 (0)