setActiveTool - do not clear selectedElementIds so customData of image can be used & do not render when deferredText is empty
This commit is contained in:
parent
482178b7b6
commit
b8ae1d2486
@ -3116,7 +3116,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
| "eraser"
|
| "eraser"
|
||||||
| "hand"
|
| "hand"
|
||||||
| "frame"
|
| "frame"
|
||||||
| "embeddable";
|
| "embeddable"
|
||||||
|
| "mermaid";
|
||||||
}
|
}
|
||||||
| { type: "custom"; customType: string },
|
| { type: "custom"; customType: string },
|
||||||
) => {
|
) => {
|
||||||
@ -3138,7 +3139,12 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
if (nextActiveTool.type !== "selection") {
|
if (nextActiveTool.type !== "selection") {
|
||||||
this.setState({
|
this.setState({
|
||||||
activeTool: nextActiveTool,
|
activeTool: nextActiveTool,
|
||||||
selectedElementIds: makeNextSelectedElementIds({}, this.state),
|
selectedElementIds: makeNextSelectedElementIds(
|
||||||
|
nextActiveTool.type === "mermaid"
|
||||||
|
? this.state.selectedElementIds
|
||||||
|
: {},
|
||||||
|
this.state,
|
||||||
|
),
|
||||||
selectedGroupIds: {},
|
selectedGroupIds: {},
|
||||||
editingGroupId: null,
|
editingGroupId: null,
|
||||||
activeEmbeddable: null,
|
activeEmbeddable: null,
|
||||||
|
@ -129,7 +129,11 @@ const MermaidToExcalidraw = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const renderExcalidrawPreview = async () => {
|
const renderExcalidrawPreview = async () => {
|
||||||
const canvasNode = canvasRef.current;
|
const canvasNode = canvasRef.current;
|
||||||
if (!canvasNode || !mermaidToExcalidrawLib.current) {
|
if (
|
||||||
|
!canvasNode ||
|
||||||
|
!mermaidToExcalidrawLib.current ||
|
||||||
|
deferredText === ""
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user