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:
Koala
2026-05-25 12:39:55 +02:00
parent 35351bdacd
commit 48bd503b5c
+1
View File
@@ -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