mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Factor out collaboration code (#2313)
Co-authored-by: Lipis <lipiridis@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
d8a0dc3b4d
commit
e617ccc252
41 changed files with 2250 additions and 2018 deletions
|
@ -173,7 +173,7 @@ const restoreAppState = (
|
|||
};
|
||||
|
||||
export const restore = (
|
||||
data: ImportedDataState,
|
||||
data: ImportedDataState | null,
|
||||
/**
|
||||
* Local AppState (`this.state` or initial state from localStorage) so that we
|
||||
* don't overwrite local state with default values (when values not
|
||||
|
@ -183,7 +183,7 @@ export const restore = (
|
|||
localAppState: Partial<AppState> | null | undefined,
|
||||
): DataState => {
|
||||
return {
|
||||
elements: restoreElements(data.elements),
|
||||
appState: restoreAppState(data.appState, localAppState || null),
|
||||
elements: restoreElements(data?.elements),
|
||||
appState: restoreAppState(data?.appState, localAppState || null),
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue