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);
|
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(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue