From 2051a712af82b6712a483dc04f4d3b307a829909 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sun, 31 May 2026 14:02:58 -0400 Subject: [PATCH] zebra-spaces: clear the 'space closing in 30s' status when host returns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit space-closing flips the top status line to a red 'host left — space closing in Ns' warning. Nothing was clearing it when the host actually came back during grace (peer-joined with role=host) or when a senior cohost auto-promoted (host-promoted). Both paths now reset the status line to 'connected as ' so the warning doesn't stick after the rescue. --- web/zebra-spaces.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index d511686..dd576d3 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -752,6 +752,12 @@ async function handleSignal(raw){ case 'peer-joined': members.set(m.uuid, { uuid:m.uuid, pubkey:m.pubkey, handle:m.handle, role:m.role, joined_at: Date.now()/1000 }); logLine('', m.handle+' joined as '+m.role); + /* if the original host rejoined during their grace window, the room + * is rescued — drop the "space closing" status from our top bar */ + if (m.role === 'host'){ + hostUUID = m.uuid; + setStatus('connected as '+myRole, 'ok'); + } /* establish mesh PC if both us and them are speakers (or mods). * present-member-offers: existing speaker offers when a new speaker * arrives. deterministic by uuid string compare. */ @@ -862,6 +868,7 @@ async function handleSignal(raw){ { const mm = members.get(m.new_host_uuid); if (mm){ mm.role = 'host'; if (m.new_host_uuid === myUUID){ myRole = 'host'; setStatus('connected as host','ok'); onRoleChanged('cohost','host'); } + else { setStatus('connected as '+myRole, 'ok'); } /* clears the space-closing warning */ logLine('', (mm.handle||shortHex(m.new_host_uuid))+' is now host'); } renderRoom(); } @@ -1215,8 +1222,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');