zebra-spaces: clear the 'space closing in 30s' status when host returns

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 <my role>' so the warning doesn't stick after
the rescue.
This commit is contained in:
Russell Ballestrini 2026-05-31 14:02:58 -04:00
parent 3a07426994
commit 2051a712af
No known key found for this signature in database

View file

@ -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');
<footer style="margin:2.2rem auto 0;font-size:0.65rem;color:#999;line-height:1.7;word-break:break-all;font-family:monospace">
<span id="pi-seal" style="color:#777;cursor:default;user-select:none" title="">page integrity</span> &nbsp;·&nbsp; built <span class="stamp-date">2026-05-31</span><br>
md5 <span class="stamp-md5">b3bd7f9e87e0dd9c976418bbcca62c2a</span><br>
sha256 <span class="stamp-sha">297d2cfc541ed03c04b0905b306b538a543304e81ca95ad8cb983516ff0ad68e</span><br>
md5 <span class="stamp-md5">1142cb5adb9819dc4ab6e4ec83710110</span><br>
sha256 <span class="stamp-sha">fbe075e39aed18c4c705d1021b6d601ebc6a22a51710429b700c7443c83848ee</span><br>
<span style="color:#bbb">hashes are of this page with these two fields zeroed — to verify, blank them and re-hash</span><br>
<span style="color:#bbb">one self-contained file — <strong>save a copy</strong> and verify against these hashes; point at your own servers with ?signal= and ?turncred=, or <a href="host-your-own.html" style="color:#999">host your own community</a></span>
</footer>