mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: add safe check for arrow points length in tranformToExcalidrawElements (#7863)
* fix: add safe check for arrow points length in tranformToExcalidrawElements * add spec * throw error only for dev mode * fix lint
This commit is contained in:
parent
8a162a4cb4
commit
a33a400f01
5 changed files with 721 additions and 39 deletions
|
@ -18,7 +18,7 @@ import { TTDDialogInput } from "./TTDDialogInput";
|
|||
import { TTDDialogOutput } from "./TTDDialogOutput";
|
||||
import { EditorLocalStorage } from "../../data/EditorLocalStorage";
|
||||
import { EDITOR_LS_KEYS } from "../../constants";
|
||||
import { debounce } from "../../utils";
|
||||
import { debounce, isDevEnv } from "../../utils";
|
||||
import { TTDDialogSubmitShortcut } from "./TTDDialogSubmitShortcut";
|
||||
|
||||
const MERMAID_EXAMPLE =
|
||||
|
@ -54,7 +54,11 @@ const MermaidToExcalidraw = ({
|
|||
mermaidToExcalidrawLib,
|
||||
setError,
|
||||
mermaidDefinition: deferredText,
|
||||
}).catch(() => {});
|
||||
}).catch((err) => {
|
||||
if (isDevEnv()) {
|
||||
console.error("Failed to parse mermaid definition", err);
|
||||
}
|
||||
});
|
||||
|
||||
debouncedSaveMermaidDefinition(deferredText);
|
||||
}, [deferredText, mermaidToExcalidrawLib]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue