zebra-spaces: preserve mute state across explicit leave/rejoin
Was: leave button cleared MUTE_STATE_KEY, so a rejoin via bless-reclaim came back unmuted regardless of prior choice. Fox: 'when I leave and rejoin the mic state is unmuted.' Now: keep MUTE_STATE_KEY in sessionStorage on leave (same tab, same identity → same preference). Next promotion or bless-reclaim restores via applyMuteState, matching the hard-refresh path's behavior. The local in-page `muted` variable still syncs to whatever's in storage so the dormant-tab state is consistent.
This commit is contained in:
parent
cb642238ed
commit
6c93549685
1 changed files with 9 additions and 4 deletions
|
|
@ -4106,8 +4106,13 @@ $('btn-leave').addEventListener('click', async () => {
|
|||
$('btn-enter').disabled = false;
|
||||
$('btn-leave').disabled = true;
|
||||
$('btn-mute').disabled = true;
|
||||
$('btn-mute').textContent = 'mute'; $('btn-mute').className=''; muted = false;
|
||||
try { sessionStorage.removeItem(MUTE_STATE_KEY); } catch(_){}
|
||||
$('btn-mute').textContent = 'mute'; $('btn-mute').className='';
|
||||
/* Preserve the user's last mute choice across leave+rejoin —
|
||||
* fox: 'when I leave and rejoin the mic state is unmuted'. Don't
|
||||
* touch MUTE_STATE_KEY here; the next promotion / bless-reclaim
|
||||
* reads it back via applyMuteState. The local `muted` variable
|
||||
* still resets so the in-page UI is clean while disconnected. */
|
||||
muted = (function(){ try { return sessionStorage.getItem(MUTE_STATE_KEY) === '1'; } catch(_){ return false; } })();
|
||||
logLine('', 'left the space');
|
||||
});
|
||||
|
||||
|
|
@ -4117,8 +4122,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> · built <span class="stamp-date">2026-06-03</span><br>
|
||||
md5 <span class="stamp-md5">035e4670e83b8d40571bdfa0ba74b1af</span><br>
|
||||
sha256 <span class="stamp-sha">99b85839b097b71b054a68440c2ede0e2e208881dd1a0cc60788039fd523cff1</span><br>
|
||||
md5 <span class="stamp-md5">cf82551642844724ea70e85e58e54595</span><br>
|
||||
sha256 <span class="stamp-sha">c885d4cac28628f633bfd3b4cf7a0527e7b40a659ab478aa9fa4454bc0e6fabf</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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue