mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-27 19:17:11 +00:00
fix: ensure username and tab title are sent and stored on initial join
This commit is contained in:
+11
-7
@@ -206,6 +206,7 @@ async function connect() {
|
||||
password: settings.password,
|
||||
peerId,
|
||||
username: settings.username,
|
||||
tabTitle: currentTabTitle,
|
||||
protocolVersion: PROTOCOL_VERSION
|
||||
});
|
||||
}
|
||||
@@ -561,14 +562,17 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
}, () => {
|
||||
if (socket && socket.readyState === WebSocket.OPEN && isNamespaceJoined) {
|
||||
// FORCE TRANSITION: Emit Join Room directly if already connected
|
||||
emit(EVENTS.JOIN_ROOM, {
|
||||
roomId,
|
||||
password,
|
||||
peerId,
|
||||
username: message.username || '', // Use username if provided by bridge
|
||||
protocolVersion: PROTOCOL_VERSION
|
||||
getSettings().then(settings => {
|
||||
emit(EVENTS.JOIN_ROOM, {
|
||||
roomId,
|
||||
password,
|
||||
peerId,
|
||||
username: settings.username, // Use local settings, not bridge
|
||||
tabTitle: currentTabTitle,
|
||||
protocolVersion: PROTOCOL_VERSION
|
||||
});
|
||||
addLog(`Joining room via link: ${roomId}`, 'info');
|
||||
});
|
||||
addLog(`Joining room via link: ${roomId}`, 'info');
|
||||
} else {
|
||||
connect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user