diff --git a/modules/rpubs/mod.ts b/modules/rpubs/mod.ts index b1907e7..ff78a84 100644 --- a/modules/rpubs/mod.ts +++ b/modules/rpubs/mod.ts @@ -350,6 +350,7 @@ export const pubsModule: RSpaceModule = { description: "Drop in a document, get a pocket book", scoping: { defaultScope: 'global', userConfigurable: true }, routes, + publicWrite: true, standaloneDomain: "rpubs.online", landingPage: renderLanding, feeds: [ diff --git a/website/canvas.html b/website/canvas.html index 424e186..66e730b 100644 --- a/website/canvas.html +++ b/website/canvas.html @@ -4425,14 +4425,21 @@ // Auto-spawn shape from ?tool= URL param (e.g. ?tool=folk-zine-gen) const toolParam = urlParams.get("tool"); if (toolParam && shapeRegistry.has(toolParam)) { - // Wait for sync to initialize, then auto-place the shape - setTimeout(() => { + const spawnToolShape = () => { newShape(toolParam); - // Clean up URL param without reload const cleanUrl = new URL(window.location.href); cleanUrl.searchParams.delete("tool"); history.replaceState(null, "", cleanUrl.pathname + cleanUrl.search); - }, 800); + }; + // Wait for sync to be ready, or fallback after 2s + if (sync._connected) { + setTimeout(spawnToolShape, 100); + } else { + let spawned = false; + const onReady = () => { if (!spawned) { spawned = true; setTimeout(spawnToolShape, 100); } }; + document.addEventListener("community-sync-ready", onReady, { once: true }); + setTimeout(onReady, 2000); // fallback if sync never fires + } } // Feed shape — pull live data from another layer/module