mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix single text element, unique id and tests
This commit is contained in:
parent
6c41e507db
commit
1c291f8b3d
4 changed files with 60 additions and 23 deletions
|
@ -135,23 +135,20 @@ export const loadSceneOrLibraryFromBlob = async (
|
|||
try {
|
||||
const data = JSON.parse(contents);
|
||||
if (isValidExcalidrawData(data)) {
|
||||
const excaldrawElements = convertToExcalidrawElements(
|
||||
data.elements || [],
|
||||
);
|
||||
return {
|
||||
type: MIME_TYPES.excalidraw,
|
||||
data: restore(
|
||||
{
|
||||
elements: clearElementsForExport(
|
||||
convertToExcalidrawElements(data.elements || []),
|
||||
),
|
||||
elements: clearElementsForExport(excaldrawElements),
|
||||
appState: {
|
||||
theme: localAppState?.theme,
|
||||
fileHandle: fileHandle || blob.handle || null,
|
||||
...cleanAppStateForExport(data.appState || {}),
|
||||
...(localAppState
|
||||
? calculateScrollCenter(
|
||||
convertToExcalidrawElements(data.elements || []),
|
||||
localAppState,
|
||||
null,
|
||||
)
|
||||
? calculateScrollCenter(excaldrawElements, localAppState, null)
|
||||
: {}),
|
||||
},
|
||||
files: data.files,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue