Import and export library from/to a file (#1940)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Mohammed Salman
2020-07-27 15:29:19 +03:00
committed by GitHub
parent 7eff6893c5
commit ee8fa6aaad
11 changed files with 199 additions and 39 deletions

View File

@@ -21,7 +21,7 @@ export const loadLibrary = (): Promise<LibraryItems> => {
return resolve([]);
}
const items = (JSON.parse(data) as ExcalidrawElement[][]).map(
const items = (JSON.parse(data) as LibraryItems).map(
(elements) => restore(elements, null).elements,
) as Mutable<LibraryItems>;