mirror of
https://github.com/zadam/trilium.git
synced 2025-12-06 15:34:26 +01:00
Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
2d3aa3a96e
commit
f976dd8d30
@ -688,7 +688,7 @@ async function downloadAsSvg(nameWithoutExtension: string, svgSource: string | S
|
|||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
scale: 2
|
scale: 2
|
||||||
});
|
});
|
||||||
await triggerDownload(`${nameWithoutExtension}.svg`, result.url);
|
triggerDownload(`${nameWithoutExtension}.svg`, result.url);
|
||||||
} finally {
|
} finally {
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export default function SvgSplitEditor({ ntxId, note, attachmentName, renderSvg,
|
|||||||
try {
|
try {
|
||||||
const svgEl = containerRef.current?.querySelector("svg");
|
const svgEl = containerRef.current?.querySelector("svg");
|
||||||
if (!svgEl) throw new Error("SVG element not found");
|
if (!svgEl) throw new Error("SVG element not found");
|
||||||
await utils.downloadAsSvg(note.title + '.svg', svgEl);
|
await utils.downloadAsSvg(note.title, svgEl);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
toast.showError(t("svg.export_to_svg"));
|
toast.showError(t("svg.export_to_svg"));
|
||||||
@ -95,7 +95,7 @@ export default function SvgSplitEditor({ ntxId, note, attachmentName, renderSvg,
|
|||||||
try {
|
try {
|
||||||
const svgEl = containerRef.current?.querySelector("svg");
|
const svgEl = containerRef.current?.querySelector("svg");
|
||||||
if (!svgEl) throw new Error("SVG element not found");
|
if (!svgEl) throw new Error("SVG element not found");
|
||||||
await utils.downloadAsPng(note.title + '.png', svgEl);
|
await utils.downloadAsPng(note.title, svgEl);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
toast.showError(t("svg.export_to_png"));
|
toast.showError(t("svg.export_to_png"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user