From f976dd8d309ac076a70da8182449aecda6f4ee55 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 4 Dec 2025 13:08:28 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- apps/client/src/services/utils.ts | 2 +- apps/client/src/widgets/type_widgets/MindMap.tsx | 2 +- .../src/widgets/type_widgets/helpers/SvgSplitEditor.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/client/src/services/utils.ts b/apps/client/src/services/utils.ts index 7e064d25f..579f8d2b8 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 db46da025..a76c26bf3 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 3d144e2ac..3c9eff27a 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"));