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
Some checks failed
app-ci-deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
parent
9f58917c39
commit
ba829be8e9
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user