fix: tunnel button stuck on "Connecting..." when already running

Re-broadcast tunnel:started SSE event when tunnel is already active
and user toggles the setting, so the client receives the URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-02-27 16:31:31 +01:00
co-authored by Claude Opus 4.6
parent 45aaf7f09a
commit 1b0a540919
4 changed files with 12 additions and 2 deletions
+4
View File
@@ -4033,6 +4033,10 @@ NOW: Generate the implementation plan for the task above. Think step by step.`;
if (tunnelEnabled && !this.tunnelManager.isRunning()) {
this.tunnelManager.start(this.port, this.https);
console.log('Tunnel started via settings change');
} else if (tunnelEnabled && this.tunnelManager.isRunning() && this.tunnelManager.getUrl()) {
// Tunnel already running — re-emit so the client gets the URL
this.broadcast('tunnel:started', { url: this.tunnelManager.getUrl() });
console.log('Tunnel already running, re-broadcast URL to client');
} else if (!tunnelEnabled && this.tunnelManager.isRunning()) {
this.tunnelManager.stop();
console.log('Tunnel stopped via settings change');