Add /reset and /sessions debug commands to web client

/reset — clears all localStorage (identity, sessions, SPK)
/sessions — shows active session peers and SPK secret prefix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 08:58:53 +04:00
parent 19f316c32b
commit c966f3bd64

View File

@@ -571,6 +571,16 @@ async function doSend() {
}
if (text === '/clear') { $messages.innerHTML = ''; return; }
if (text === '/debug') { DEBUG = !DEBUG; addSys('Debug logging: ' + (DEBUG ? 'ON (check browser console)' : 'OFF')); return; }
if (text === '/reset') {
localStorage.clear();
addSys('localStorage cleared. Refresh the page to start fresh.');
return;
}
if (text === '/sessions') {
addSys('Sessions: ' + Object.keys(sessions).join(', '));
addSys('SPK secret: ' + (mySpkSecretHex ? mySpkSecretHex.slice(0,16) + '...' : 'NONE'));
return;
}
if (text === '/quit') { window.close(); return; }
if (text === '/glist') { await groupList(); return; }
if (text === '/dm') { currentGroup = null; addSys('Switched to DM mode'); $peerInput.value = localStorage.getItem('wz-peer') || ''; return; }