fix(RevealManager): prevent GM listeners when disconnected

Only initialize GM hover listeners if the user is both a GM and
connected.
This commit is contained in:
hypercross 2026-07-07 23:17:57 +08:00
parent 4eaf6aab16
commit 48776424a7
1 changed files with 2 additions and 3 deletions

View File

@ -95,11 +95,11 @@ export const RevealManager: Component = () => {
if (dom) cleanupInjections(dom); if (dom) cleanupInjections(dom);
}); });
// ---- GM hover listeners ---- // ---- GM hover listeners (only when connected as GM) ----
createEffect(() => { createEffect(() => {
const dom = contentDom(); const dom = contentDom();
const state = journalStreamState; const state = journalStreamState;
if (!dom || state.myRole !== "gm") return; if (!dom || state.myRole !== "gm" || !state.connected) return;
const normalized = normalizePath(location.pathname); const normalized = normalizePath(location.pathname);
const data = comp.data; const data = comp.data;
@ -121,7 +121,6 @@ export const RevealManager: Component = () => {
const combinedSlug = colSlug const combinedSlug = colSlug
? pageSparkSlugs.find((s) => s.endsWith(`-${colSlug}`)) ? pageSparkSlugs.find((s) => s.endsWith(`-${colSlug}`))
: undefined; : undefined;
console.log(data.sparkTables, normalized, pageSparkSlugs, colSlug);
if (combinedSlug) { if (combinedSlug) {
show({ show({
rect: sparkTable.getBoundingClientRect(), rect: sparkTable.getBoundingClientRect(),