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>
This commit is contained in:
Judicael 2022-09-07 17:08:32 +03:00 committed by GitHub
parent e1689d678e
commit ef613af788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = {