mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-06 01:17:42 +00:00
fix(popup): seed lastKnownPeers in init() to prevent false join toasts
init() called updatePeerList() directly but never set lastKnownPeers. On the first PEER_UPDATE message (heartbeat, play/pause, any state change), detectPeerChanges() saw lastKnownPeers=[] and treated ALL peers including self as newly joined — triggering 'name joined the room' toast on every action while the popup was open.
This commit is contained in:
@@ -109,6 +109,7 @@ async function init() {
|
||||
localPeerId = res.peerId;
|
||||
applyConnectionStatus(res.status);
|
||||
updatePeerList(res.peers);
|
||||
lastKnownPeers = res.peers || [];
|
||||
if (res.lastActionState) updateLastActionUI(res.lastActionState, res.peers);
|
||||
|
||||
// Populate Tabs using the background's targetTabId
|
||||
|
||||
Reference in New Issue
Block a user