Revert "Remove unused project name from export dialog (#2427)" (#2436)

This commit is contained in:
David Luzar 2020-12-01 14:00:13 +01:00 committed by GitHub
parent 084aff2bf3
commit 36980160ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 605 additions and 0 deletions

View file

@ -283,12 +283,14 @@ export const exportCanvas = async (
exportBackground,
exportPadding = 10,
viewBackgroundColor,
name,
scale = 1,
shouldAddWatermark,
}: {
exportBackground: boolean;
exportPadding?: number;
viewBackgroundColor: string;
name: string;
scale?: number;
shouldAddWatermark: boolean;
},
@ -314,6 +316,7 @@ export const exportCanvas = async (
});
if (type === "svg") {
await fileSave(new Blob([tempSvg.outerHTML], { type: "image/svg+xml" }), {
fileName: `${name}.svg`,
extensions: [".svg"],
});
return;
@ -334,6 +337,7 @@ export const exportCanvas = async (
document.body.appendChild(tempCanvas);
if (type === "png") {
const fileName = `${name}.png`;
let blob = await canvasToBlob(tempCanvas);
if (appState.exportEmbedScene) {
blob = await (
@ -345,6 +349,7 @@ export const exportCanvas = async (
}
await fileSave(blob, {
fileName,
extensions: [".png"],
});
} else if (type === "clipboard") {

View file

@ -36,6 +36,7 @@ export const saveAsJSON = async (
const fileHandle = await fileSave(
blob,
{
fileName: appState.name,
description: "Excalidraw file",
extensions: [".excalidraw"],
},