mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
fix(mermaid): matrix not inversible
This commit is contained in:
parent
f8533eb2c6
commit
26be131b4b
@ -163,19 +163,14 @@ function useResizer(containerRef: RefObject<HTMLDivElement>, noteId: string, svg
|
||||
pan: zoomInstance.getPan(),
|
||||
zoom: zoomInstance.getZoom()
|
||||
}
|
||||
try {
|
||||
zoomInstance.destroy();
|
||||
} catch (e) {
|
||||
// Sometimes crashes with "Matrix is not invertible" which can cause havoc such as breaking the popup editor from ever showing up again.
|
||||
console.warn(e);
|
||||
}
|
||||
zoomInstance.destroy();
|
||||
};
|
||||
}, [ svg ]);
|
||||
|
||||
// React to container changes.
|
||||
const width = useElementSize(containerRef);
|
||||
useEffect(() => {
|
||||
if (!zoomRef.current) return;
|
||||
if (!zoomRef.current || (width?.width ?? 0) === 0) return;
|
||||
zoomRef.current.resize().fit().center();
|
||||
}, [ width ]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user