mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix
This commit is contained in:
parent
7087db42c0
commit
59e8bf498d
9 changed files with 109 additions and 65 deletions
|
@ -13,6 +13,7 @@ import { FileSystemHandle, nativeFileSystemSupported } from "./filesystem";
|
|||
import { isValidExcalidrawData, isValidLibrary } from "./json";
|
||||
import { restore, restoreLibraryItems } from "./restore";
|
||||
import { ImportedLibraryData } from "./types";
|
||||
import { convertToExcalidrawElements } from "../element/newElement";
|
||||
|
||||
const parseFileContents = async (blob: Blob | File) => {
|
||||
let contents: string;
|
||||
|
@ -138,14 +139,16 @@ export const loadSceneOrLibraryFromBlob = async (
|
|||
type: MIME_TYPES.excalidraw,
|
||||
data: restore(
|
||||
{
|
||||
elements: clearElementsForExport(data.elements || []),
|
||||
elements: clearElementsForExport(
|
||||
convertToExcalidrawElements(data.elements || []),
|
||||
),
|
||||
appState: {
|
||||
theme: localAppState?.theme,
|
||||
fileHandle: fileHandle || blob.handle || null,
|
||||
...cleanAppStateForExport(data.appState || {}),
|
||||
...(localAppState
|
||||
? calculateScrollCenter(
|
||||
data.elements || [],
|
||||
convertToExcalidrawElements(data.elements || []),
|
||||
localAppState,
|
||||
null,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue