Fix SignalR connection error handling for offline hub

Wrap connection.start() in try/catch so that when the SignalR hub is
unreachable the status transitions to "offline" silently instead of
throwing unhandled errors that flood the browser console.
This commit is contained in:
2026-04-15 20:58:01 +03:00
parent 8bfd7109ab
commit e8935276a0
+7 -2
View File
@@ -141,8 +141,13 @@ export class SignalRConnection {
this.setStatus("live");
});
await this.connection.start();
this.setStatus("live");
try {
await this.connection.start();
this.setStatus("live");
} catch {
// Hub unreachable — go offline silently, don't retry-spam
this.setStatus("offline");
}
}
private setStatus(s: ConnectionStatus): void {