fix: ensure demo community visibility is always public on startup

The demo Automerge doc had visibility: "private" from initial creation.
ensureDemoCommunity now forces visibility to "public" on every startup
if it drifted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-24 13:21:59 -07:00
parent 90d511077c
commit f2c3245240
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import {
getDocumentData,
loadCommunity,
markShapesSeeded,
updateSpaceMeta,
} from "./community-store";
// ── Alpine Explorer 2026 — Demo Scenario ──────────────────────────
@ -780,6 +781,12 @@ export async function ensureDemoCommunity(): Promise<void> {
console.log("[Demo] Created demo community with visibility: public");
} else {
await loadCommunity("demo");
// Ensure visibility stays "public" (older docs may have been created as "private")
const doc = getDocumentData("demo");
if (doc?.meta?.visibility !== "public") {
updateSpaceMeta("demo", { visibility: "public" });
console.log("[Demo] Fixed demo visibility → public");
}
}
// Check if already seeded (has shapes or was previously seeded then cleared)