Fix broken files (#3821)

This PR fixes a bug that prevented files (which included an arrow) from
opening correctly.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix

### Test Plan

1. Open a file that includes at least one arrow
pull/3787/head
Steve Ruiz 2024-05-23 21:03:58 +01:00 zatwierdzone przez GitHub
rodzic 87e3d60c90
commit 58104c1a4c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -18,7 +18,6 @@ import {
createTLStore,
exhaustiveSwitchError,
partition,
transact,
} from '@tldraw/editor'
import { TLUiToastsContextType } from '../../ui/context/toasts'
import { TLUiTranslationKey } from '../../ui/hooks/useTranslation/TLUiTranslationKey'
@ -292,7 +291,7 @@ export async function parseAndLoadDocument(
// just restore everything, so if the user has opened
// this file before they'll get their camera etc.
// restored. we could change this in the future.
transact(() => {
editor.store.atomic(() => {
const initialBounds = editor.getViewportScreenBounds().clone()
const isFocused = editor.getInstanceState().isFocused
editor.store.clear()