retain local appState props on restore (#2224)

Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
David Luzar 2020-10-13 13:46:52 +02:00 committed by GitHub
parent b91f929503
commit 7618ca48d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 153 additions and 69 deletions

View file

@ -45,13 +45,13 @@ export const saveAsJSON = async (
);
};
export const loadFromJSON = async (appState: AppState) => {
export const loadFromJSON = async (localAppState: AppState) => {
const blob = await fileOpen({
description: "Excalidraw files",
extensions: [".json", ".excalidraw"],
mimeTypes: ["application/json"],
});
return loadFromBlob(blob, appState);
return loadFromBlob(blob, localAppState);
};
export const isValidLibrary = (json: any) => {