From 48776424a78aaa898ac20d8c09c72d9e344800d4 Mon Sep 17 00:00:00 2001 From: hypercross Date: Tue, 7 Jul 2026 23:17:57 +0800 Subject: [PATCH] fix(RevealManager): prevent GM listeners when disconnected Only initialize GM hover listeners if the user is both a GM and connected. --- src/components/RevealManager.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/RevealManager.tsx b/src/components/RevealManager.tsx index 06170f4..983bc90 100644 --- a/src/components/RevealManager.tsx +++ b/src/components/RevealManager.tsx @@ -95,11 +95,11 @@ export const RevealManager: Component = () => { if (dom) cleanupInjections(dom); }); - // ---- GM hover listeners ---- + // ---- GM hover listeners (only when connected as GM) ---- createEffect(() => { const dom = contentDom(); const state = journalStreamState; - if (!dom || state.myRole !== "gm") return; + if (!dom || state.myRole !== "gm" || !state.connected) return; const normalized = normalizePath(location.pathname); const data = comp.data; @@ -121,7 +121,6 @@ export const RevealManager: Component = () => { const combinedSlug = colSlug ? pageSparkSlugs.find((s) => s.endsWith(`-${colSlug}`)) : undefined; - console.log(data.sparkTables, normalized, pageSparkSlugs, colSlug); if (combinedSlug) { show({ rect: sparkTable.getBoundingClientRect(),