mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-28 12:59:45 +00:00
fix: clear peer list immediately when leaving a room
This commit is contained in:
@@ -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' });
|
||||
|
||||
@@ -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([]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user