feat: resave to png/svg with metadata if you loaded your scene from a png/svg file (#3645)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
David Laban 2021-07-15 09:54:26 -04:00 committed by GitHub
parent 9581c45522
commit 685abac81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 108 additions and 15 deletions

View file

@ -4,7 +4,7 @@ import { EXPORT_DATA_TYPES, EXPORT_SOURCE, MIME_TYPES } from "../constants";
import { clearElementsForExport } from "../element";
import { ExcalidrawElement } from "../element/types";
import { AppState } from "../types";
import { loadFromBlob } from "./blob";
import { isImageFileHandle, loadFromBlob } from "./blob";
import {
ExportedDataState,
@ -44,7 +44,7 @@ export const saveAsJSON = async (
description: "Excalidraw file",
extensions: [".excalidraw"],
},
appState.fileHandle,
isImageFileHandle(appState.fileHandle) ? null : appState.fileHandle,
);
return { fileHandle };
};