Skip to content

Build your personal knowledge base with Trilium Notes

Apply suggestions from code review

Lucasf976dd8d309a
diff --git a/apps/client/src/services/utils.ts b/apps/client/src/services/utils.ts
index 7e064d25f7..579f8d2b86 100644
--- a/apps/client/src/services/utils.ts
+++ b/apps/client/src/services/utils.ts
@@ -688,7 +688,7 @@ async function downloadAsSvg(nameWithoutExtension: string, svgSource: string | S
backgroundColor: "transparent",
scale: 2
});
- await triggerDownload(`${nameWithoutExtension}.svg`, result.url);
+ triggerDownload(`${nameWithoutExtension}.svg`, result.url);
} finally {
cleanup();
}
diff --git a/apps/client/src/widgets/type_widgets/MindMap.tsx b/apps/client/src/widgets/type_widgets/MindMap.tsx
index db46da0257..a76c26bf31 100644
--- a/apps/client/src/widgets/type_widgets/MindMap.tsx
+++ b/apps/client/src/widgets/type_widgets/MindMap.tsx
@@ -102,7 +102,7 @@ export default function MindMap({ note, ntxId, noteContext }: TypeWidgetProps) {
// Export as PNG or SVG.
useTriliumEvents([ "exportSvg", "exportPng" ], async ({ ntxId: eventNtxId }, eventName) => {
if (eventNtxId !== ntxId || !apiRef.current) return;
- const nodes = apiRef.current.nodes;
+ const nodes = apiRef.current.nodes;
if (eventName === "exportSvg") {
await utils.downloadAsSvg(note.title, nodes);
} else {
diff --git a/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx b/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
index 3d144e2ac0..3c9eff27a9 100644
--- a/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
+++ b/apps/client/src/widgets/type_widgets/helpers/SvgSplitEditor.tsx
@@ -83,7 +83,7 @@ export default function SvgSplitEditor({ ntxId, note, attachmentName, renderSvg,
try {
const svgEl = containerRef.current?.querySelector("svg");
if (!svgEl) throw new Error("SVG element not found");
- await utils.downloadAsSvg(note.title + '.svg', svgEl);
+ await utils.downloadAsSvg(note.title, svgEl);
} catch (e) {
console.warn(e);
toast.showError(t("svg.export_to_svg"));
@@ -95,7 +95,7 @@ export default function SvgSplitEditor({ ntxId, note, attachmentName, renderSvg,
try {
const svgEl = containerRef.current?.querySelector("svg");
if (!svgEl) throw new Error("SVG element not found");
- await utils.downloadAsPng(note.title + '.png', svgEl);
+ await utils.downloadAsPng(note.title, svgEl);
} catch (e) {
console.warn(e);
toast.showError(t("svg.export_to_png"));