fix: 10s timeout on handshake CallAnswer; button stays visible during connect
- handshake.rs: add 10s timeout on recv_signal() waiting for CallAnswer — previously hung forever if relay didn't respond, making join button disappear with no feedback - main.ts: keep join button visible + show "Connecting…" state instead of hiding it before the await; button restores correctly on error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -331,7 +331,9 @@ joinVoiceBtn.addEventListener("click", async () => {
|
||||
const s = loadSettings();
|
||||
if (!relay) { showToast("No relay configured"); return; }
|
||||
connectPending = true;
|
||||
joinVoiceBtn.classList.add("hidden");
|
||||
const origText = joinVoiceBtn.textContent;
|
||||
joinVoiceBtn.textContent = "Connecting…";
|
||||
(joinVoiceBtn as HTMLButtonElement).disabled = true;
|
||||
try {
|
||||
await invoke("connect", {
|
||||
relay: relay.address,
|
||||
@@ -344,9 +346,10 @@ joinVoiceBtn.addEventListener("click", async () => {
|
||||
} catch (e: any) {
|
||||
console.error("connect failed:", e);
|
||||
showToast(`Join failed: ${e}`);
|
||||
joinVoiceBtn.classList.remove("hidden");
|
||||
} finally {
|
||||
connectPending = false;
|
||||
joinVoiceBtn.textContent = origText;
|
||||
(joinVoiceBtn as HTMLButtonElement).disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user