mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-15 05:20:27 +02:00
fix: remove dependency of t from clipboard and image (#7712)
* fix: remove dependency of t from clipboard and image * pass errorMessage to copyTextToSystemClipboard where needed * wrap copyTextToSystemClipboard and rethrow translated error in caller * review fix * typo
This commit is contained in:
@@ -133,9 +133,12 @@ export const exportCanvas = async (
|
||||
},
|
||||
);
|
||||
} else if (type === "clipboard-svg") {
|
||||
await copyTextToSystemClipboard(
|
||||
await svgPromise.then((svg) => svg.outerHTML),
|
||||
);
|
||||
const svg = await svgPromise.then((svg) => svg.outerHTML);
|
||||
try {
|
||||
await copyTextToSystemClipboard(svg);
|
||||
} catch (e) {
|
||||
throw new Error(t("errors.copyToSystemClipboardFailed"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user