updates to production

This commit is contained in:
Jeff Emmett 2025-11-10 18:57:04 -08:00
parent 5e11183557
commit 04135a5487
1 changed files with 11 additions and 1 deletions

View File

@ -634,7 +634,17 @@ export function Board() {
// Only render Tldraw when store is ready and synced // Only render Tldraw when store is ready and synced
// This ensures shapes are loaded before Tldraw initializes // This ensures shapes are loaded before Tldraw initializes
if (!store.store || store.status !== 'synced-remote') { // In production, be more lenient - allow rendering if store exists and has shapes
const isProduction = import.meta.env.PROD || import.meta.env.MODE === 'production'
const hasStore = !!store.store
const isSynced = store.status === 'synced-remote'
const hasShapes = store.store ? store.store.allRecords().filter((r: any) => r.typeName === 'shape').length > 0 : false
// In production, allow rendering if store exists and has shapes, even if not fully synced
// This handles cases where network issues prevent 'synced-remote' status
const shouldRender = hasStore && (isSynced || (isProduction && hasShapes))
if (!shouldRender) {
return ( return (
<AutomergeHandleProvider handle={automergeHandle}> <AutomergeHandleProvider handle={automergeHandle}>
<div style={{ position: "fixed", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }}> <div style={{ position: "fixed", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }}>