Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/type_widget): mind map attachment incorrect

Elian Doran58b14ae31ccc
diff --git a/apps/client/src/widgets/type_widgets/MindMap.tsx b/apps/client/src/widgets/type_widgets/MindMap.tsx
index ffe4d8aa86..611dffbc0b 100644
--- a/apps/client/src/widgets/type_widgets/MindMap.tsx
+++ b/apps/client/src/widgets/type_widgets/MindMap.tsx
@@ -26,7 +26,7 @@ export default function MindMap({ note, ntxId }: TypeWidgetProps) {
const containerRef = useRef<HTMLDivElement>(null);
const spacedUpdate = useEditorSpacedUpdate({
note,
- getData: () => {
+ getData: async () => {
if (!apiRef.current) return;
return {
content: apiRef.current.getDataString(),
@@ -35,7 +35,7 @@ export default function MindMap({ note, ntxId }: TypeWidgetProps) {
role: "image",
title: "mindmap-export.svg",
mime: "image/svg+xml",
- content: apiRef.current.exportSvg().text(),
+ content: await apiRef.current.exportSvg().text(),
position: 0
}
]