From 48bd503b5cecca8054c5b3c6e77eeccdfcca6fa7 Mon Sep 17 00:00:00 2001 From: Koala <6156589+Shik3i@users.noreply.github.com> Date: Mon, 25 May 2026 12:39:55 +0200 Subject: [PATCH] fix(popup): seed lastKnownPeers in init() to prevent false join toasts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- extension/popup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/popup.js b/extension/popup.js index b6e1561..0b956fb 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -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