fix: preserve remembered browser identity on exit

This commit is contained in:
illusia committed 2026-09-03 23:40:38 +08:00
1 parent 96ba467d52
commit cb3dbe4ca4
3 files changed
+24 -5

No files matched your search

+2 -1
View File
@@ -1054,6 +1054,7 @@ export function useVoiceWebSocket() {
function disconnect(preserveConnection = false): void {
connectionSequence++;
const keepRememberedIdentity = lastConnection?.rememberIdentity === true;
if (!preserveConnection) lastConnection = null;
stopMicrophone();
const socket = ws.value;
@@ -1067,7 +1068,7 @@ export function useVoiceWebSocket() {
state.reconnectFailed = false;
state.tsClientId = 0;
state.errorCode = "";
identityMaterial.value = "";
if (!keepRememberedIdentity) identityMaterial.value = "";
members.length = 0;
channels.length = 0;
chatMessages.length = 0;