fix: clear peer list immediately when leaving a room

This commit is contained in:
Timo
2026-04-22 11:39:27 +02:00
parent a847719b24
commit 5ccdd273cf
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -509,6 +509,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
currentRoom = null;
if (storageInitialized) chrome.storage.session.set({ currentRoom: null });
addLog('Left Room', 'info');
chrome.runtime.sendMessage({ type: 'PEER_UPDATE', peers: [] }).catch(() => {});
} else if (message.type === 'CLEAR_LOGS') {
logs = [];
sendResponse({ status: 'ok' });
+2
View File
@@ -114,6 +114,8 @@ function updateUI(roomId, password, useCustomServer = false, serverUrl = '') {
elements.activeServer.textContent = useCustomServer ? (serverUrl || 'Custom Server') : 'Official Server';
elements.activeServer.title = useCustomServer ? (serverUrl || '') : 'sync.shik3i.net';
}
} else {
updatePeerList([]);
}
}