diff --git a/src/pages/tldraw/singlePlayerPage.tsx b/src/pages/tldraw/singlePlayerPage.tsx index 647763d..304eb0c 100644 --- a/src/pages/tldraw/singlePlayerPage.tsx +++ b/src/pages/tldraw/singlePlayerPage.tsx @@ -6,7 +6,8 @@ import { useTldrawUser, DEFAULT_SUPPORT_VIDEO_TYPES, DEFAULT_SUPPORTED_IMAGE_TYPES, - TLStore + TLStore, + createTLStore, } from '@tldraw/tldraw'; import { useTLDraw } from '../../contexts/TLDrawContext'; import { useAuth } from '../../contexts/AuthContext'; @@ -93,10 +94,11 @@ export default function SinglePlayerPage() { const run = async () => { try { setCanvasPhase('store-init'); - const newStore = localStoreService.getStore({ + // Create a fresh store directly — bypassing singleton to avoid disposed-store reuse issues + const newStore = createTLStore({ schema: customSchema, shapeUtils: allShapeUtils, - bindingUtils: allBindingUtils + bindingUtils: allBindingUtils, }); const snapSvc = new NavigationSnapshotService(newStore, editorRef.current || undefined); @@ -154,7 +156,6 @@ export default function SinglePlayerPage() { snapshotServiceRef.current = null; storeRef.current?.dispose(); storeRef.current = null; - localStoreService.clearStore(); // reset singleton so next getStore() creates a fresh store setStoreReady(false); setCanvasPhase('idle'); };