feat: implement one-click auto-join and self-closing bridge with countdown

This commit is contained in:
Timo
2026-04-22 12:29:09 +02:00
parent 901b97dcaf
commit 0509b993e5
3 changed files with 31 additions and 4 deletions
+3
View File
@@ -596,6 +596,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
useCustomServer: !!useCustomServer,
serverUrl: serverUrl || ''
}, () => {
broadcastConnectionStatus('connecting');
if (socket && socket.readyState === WebSocket.OPEN && isNamespaceJoined) {
// FORCE TRANSITION: Emit Join Room directly if already connected
getSettings().then(settings => {
@@ -612,7 +613,9 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
} else {
connect();
}
sendResponse({ status: 'ok' });
});
return true; // Keep channel open for async getSettings
} else if (message.type === 'REGENERATE_ID') {
const newId = self.crypto.randomUUID().substring(0, 8);
chrome.storage.local.set({ peerId: newId }, () => {