remove dependency of i18n from getDefaultAppState and make it pure

This commit is contained in:
Aakansha Doshi
2020-12-27 18:18:07 +05:30
parent bc414ccaaf
commit eda35a25b3
15 changed files with 123 additions and 90 deletions
+3 -2
View File
@@ -8,6 +8,8 @@ import { Library } from "./library";
import { MIME_TYPES } from "../constants";
import { clearElementsForExport } from "../element";
import { EVENT_LIBRARY, trackEvent } from "../analytics";
import { t } from "../i18n";
import { getDateTime } from "../utils";
export const serializeAsJSON = (
elements: readonly ExcalidrawElement[],
@@ -33,11 +35,10 @@ export const saveAsJSON = async (
const blob = new Blob([serialized], {
type: "application/json",
});
const fileHandle = await fileSave(
blob,
{
fileName: appState.name,
fileName: appState.name || `${t("labels.untitled")}-${getDateTime()}`,
description: "Excalidraw file",
extensions: [".excalidraw"],
},