Skip to content

Commit ca0c367

Browse files
committed
fix FW download.
1 parent c54f041 commit ca0c367

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

webapp/src/ui/firmwarePanel.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,7 @@ export class FirmwarePanel {
184184
}): Promise<void> {
185185
if (this.busy) return;
186186
if (!this.conn || !this.conn.isConnected) {
187-
alert(
188-
`Connect to the device before updating the ${opts.kind}.\n\n` +
189-
`[debug] conn=${this.conn ? 'set' : 'null'} ` +
190-
`state=${this.conn?.state ?? 'n/a'} ` +
191-
`isConnected=${this.conn?.isConnected ?? 'n/a'}`,
192-
);
187+
alert(`Connect to the device before updating the ${opts.kind}.`);
193188
return;
194189
}
195190

webapp/src/ui/statusPage.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,19 @@ export class StatusPage {
264264
this.fwMount.classList.toggle('hidden', !connected);
265265
this.dbgMount.classList.toggle('hidden', !connected);
266266

267-
// Nav panel stays visible while disconnected (search/preview are useful
268-
// pre-connection); it just reflects connection state on its Send button.
267+
// Reflect connection state on the panels on EVERY render. This must not clear
268+
// the connection only in the disconnected branch: during connect, the
269+
// intermediate 'requesting'/'connecting' states would clear it and the final
270+
// 'connected' state would never restore it (the panel would be left null even
271+
// though we're connected). Set based on `connected` every time instead.
269272
this.navigationPanel.setConnection(connected ? this.conn : null);
273+
this.firmwarePanel.setConnection(connected ? this.conn : null);
274+
this.debugPanel.setConnection(connected ? this.conn : null);
270275

271276
if (connected) {
272277
this.deviceVal.textContent = this.conn?.deviceName ?? DASH;
273278
} else {
274279
this.resetDetails();
275-
this.firmwarePanel.setConnection(null);
276-
this.debugPanel.setConnection(null);
277280
}
278281
}
279282

0 commit comments

Comments
 (0)