From c630e1f8be9e2717244753984d152382a032e2b5 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Wed, 8 Sep 2021 12:09:03 +0100 Subject: [PATCH] Fix change to loadDocument --- .github/workflows/main.yml | 2 +- packages/tldraw/src/state/tlstate.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6a409954..90b057ee0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,4 +17,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - test-command: 'yarn test' + test-command: 'yarn test --ci --runInBand' diff --git a/packages/tldraw/src/state/tlstate.ts b/packages/tldraw/src/state/tlstate.ts index 7c5bb1ccc..27ec1d84a 100644 --- a/packages/tldraw/src/state/tlstate.ts +++ b/packages/tldraw/src/state/tlstate.ts @@ -538,7 +538,17 @@ export class TLDrawState extends StateManager { this.clearSelectHistory() this.session = undefined this.selectedGroupId = undefined - return this.updateDocument(document, 'loaded_document') + return this.replaceState( + { + ...defaultState, + document, + appState: { + ...defaultState.appState, + currentPageId: Object.keys(document.pages)[0], + }, + }, + 'loaded_document' + ) } /**