fix(canvas): call ensureStoreIsUsable() before tldraw mount — pre-initializes TLINSTANCE/page/camera records in empty store preventing currentPageId crash
Some checks failed
app-ci-deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
CC Worker 2026-06-01 06:10:11 +00:00
parent 9f58917c39
commit ba829be8e9

View File

@ -98,6 +98,9 @@ export default function SinglePlayerPage() {
shapeUtils: allShapeUtils,
bindingUtils: allBindingUtils
});
// Pre-initialize tldraw's required records (TLINSTANCE, page, cameras)
// so computed signals that read currentPageId don't crash before Editor construction completes
(newStore as unknown as { ensureStoreIsUsable(): void }).ensureStoreIsUsable();
const snapSvc = new NavigationSnapshotService(newStore, editorRef.current || undefined);
if (accessToken) snapSvc.setAccessToken(accessToken);