change function name, and useffect dep
This commit is contained in:
parent
6079b3cb14
commit
4ec151ba4f
2 changed files with 3 additions and 4 deletions
|
@ -241,7 +241,7 @@ export function Tldraw({
|
|||
if (Object.keys(state).length) {
|
||||
app.ready.then(() => {
|
||||
if ('page' in state) {
|
||||
app.loadDocumentFromURL(state.page, state.pageState)
|
||||
app.loadPageFromURL(state.page, state.pageState)
|
||||
} else {
|
||||
const nextDocument = state as TDDocument
|
||||
if (nextDocument.id === app.document.id) {
|
||||
|
@ -252,7 +252,7 @@ export function Tldraw({
|
|||
}
|
||||
})
|
||||
}
|
||||
}, [app, decodedPage])
|
||||
}, [app])
|
||||
|
||||
// Update the document if the `document` prop changes but the ids,
|
||||
// are the same, or else load a new document if the ids are different.
|
||||
|
|
|
@ -1395,8 +1395,7 @@ export class TldrawApp extends StateManager<TDSnapshot> {
|
|||
* @param pageState
|
||||
* @returns
|
||||
*/
|
||||
loadDocumentFromURL = (page: TDPage, pageState: Record<string, TLPageState>) => {
|
||||
const { currentPageId } = this
|
||||
loadPageFromURL = (page: TDPage, pageState: Record<string, TLPageState>) => {
|
||||
const pageId = page.id
|
||||
const nextDocument = {
|
||||
...this.state.document,
|
||||
|
|
Loading…
Reference in a new issue