diff --git a/server/index.ts b/server/index.ts index 8846965..3b4a7c1 100644 --- a/server/index.ts +++ b/server/index.ts @@ -2037,15 +2037,11 @@ app.get("/:space/:moduleId/template", async (c) => { import type { RSpaceModule } from "../shared/module"; import { resolveDataSpace } from "../shared/scope-resolver"; -function moduleHasData(space: string, mod: RSpaceModule): boolean { - if (space === "demo") return true; // demo always has data - if (!mod.docSchemas || mod.docSchemas.length === 0) return true; // no schemas = can't detect - for (const schema of mod.docSchemas) { - if (!schema.pattern.includes('{space}')) return true; // global module, always show - const prefix = schema.pattern.replace('{space}', space).split(':').slice(0, 3).join(':'); - if (syncServer.hasDocsWithPrefix(prefix)) return true; - } - return false; +function moduleHasData(_space: string, _mod: RSpaceModule): boolean { + // Always show the module's own UI — let each module handle its empty state. + // Previously demo returned true while live spaces checked for CRDT docs, + // causing live spaces to show a generic onboarding page instead of the module. + return true; } // ── Mount module routes under /:space/:moduleId ──