fix production automerge

This commit is contained in:
Jeff Emmett 2025-11-10 18:29:19 -08:00
parent 3072dc70c0
commit bda2523e3b
1 changed files with 13 additions and 2 deletions

View File

@ -237,7 +237,6 @@ export function Board() {
// Only check if store is synced // Only check if store is synced
if (store.status !== 'synced-remote') { if (store.status !== 'synced-remote') {
console.log(`📊 Board: Store not synced yet (status: ${store.status}), skipping shape check`)
return return
} }
@ -383,7 +382,7 @@ export function Board() {
return () => { return () => {
unsubscribe() unsubscribe()
} }
}, [editor, store.store]) }, [editor, store.store, store.status])
// Update presence when session changes // Update presence when session changes
useEffect(() => { useEffect(() => {
@ -519,6 +518,18 @@ export function Board() {
}; };
}, [editor]); }, [editor]);
// Only render Tldraw when store is ready and synced
// This ensures shapes are loaded before Tldraw initializes
if (!store.store || store.status !== 'synced-remote') {
return (
<AutomergeHandleProvider handle={automergeHandle}>
<div style={{ position: "fixed", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }}>
<div>Loading canvas...</div>
</div>
</AutomergeHandleProvider>
)
}
return ( return (
<AutomergeHandleProvider handle={automergeHandle}> <AutomergeHandleProvider handle={automergeHandle}>
<div style={{ position: "fixed", inset: 0 }}> <div style={{ position: "fixed", inset: 0 }}>