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:
parent
4eaf6aab16
commit
48776424a7
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue