mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-24 01:40:41 +02:00
fix: remove dependency of t in blob.ts (#7717)
* remove dependency of t in blob.ts * fix
This commit is contained in:
@@ -10,6 +10,7 @@ import { NonDeletedExcalidrawElement } from "../../element/types";
|
||||
import { AppClassProperties, BinaryFiles } from "../../types";
|
||||
import { canvasToBlob } from "../../data/blob";
|
||||
import { EditorLocalStorage } from "../../data/EditorLocalStorage";
|
||||
import { t } from "../../i18n";
|
||||
|
||||
const resetPreview = ({
|
||||
canvasRef,
|
||||
@@ -108,7 +109,14 @@ export const convertMermaidToExcalidraw = async ({
|
||||
});
|
||||
// if converting to blob fails, there's some problem that will
|
||||
// likely prevent preview and export (e.g. canvas too big)
|
||||
await canvasToBlob(canvas);
|
||||
try {
|
||||
await canvasToBlob(canvas);
|
||||
} catch (e: any) {
|
||||
if (e.name === "CANVAS_POSSIBLY_TOO_BIG") {
|
||||
throw new Error(t("canvasError.canvasTooBig"));
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
parent.style.background = "var(--default-bg-color)";
|
||||
canvasNode.replaceChildren(canvas);
|
||||
} catch (err: any) {
|
||||
|
Reference in New Issue
Block a user