fix(onboarding): remove moduleHasData gate so live spaces show module UI
Live spaces with no CRDT data were showing a generic onboarding page instead of the module's actual UI. Demo always bypassed this check, causing visual parity issues between demo.rspace.online and live spaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
36e76449fa
commit
dbe60f2711
|
|
@ -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 ──
|
||||
|
|
|
|||
Loading…
Reference in New Issue