feat: auto-join #ops on first login (web + TUI)

New users with no peer/group set automatically join #ops so they
have someone to talk to. Saved peer overrides this on subsequent visits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-29 13:54:19 +04:00
parent 3e583bb04b
commit f04c24187d
2 changed files with 30 additions and 1 deletions

View File

@@ -925,9 +925,20 @@ async function enterChat() {
addSys('/alias · /g · /gleave · /gkick · /gmembers · /glist · /friend · /file · /info');
const savedPeer = localStorage.getItem('wz-peer');
if (savedPeer) $peerInput.value = savedPeer;
if (savedPeer) {
$peerInput.value = savedPeer;
}
connectWebSocket();
// Auto-join #ops if no peer/group set
if (!savedPeer) {
setTimeout(async () => {
await groupSwitch('ops');
addSys('Welcome! You have been added to #ops');
}, 500);
}
$input.focus();
}