fix: include assets when importing document (package tldraw) (#950)

* fix: include asset when importing document

* defensive tweak

* fixey back

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
remove-mobx
Judicael 2022-09-07 17:08:32 +03:00 zatwierdzone przez GitHub
rodzic e1689d678e
commit ef613af788
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -1306,7 +1306,13 @@ export class TldrawApp extends StateManager<TDSnapshot> {
updateDocument = (document: TDDocument, reason = 'updated_document'): this => {
const prevState = this.state
const nextState = { ...prevState, document: { ...prevState.document } }
const nextState = {
...prevState,
document: {
...prevState.document,
assets: document.assets,
},
}
if (!document.pages[this.currentPageId]) {
nextState.appState = {