mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-11-04 12:54:23 +01: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:
		@@ -3,7 +3,6 @@
 | 
			
		||||
// -----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
import { MIME_TYPES, SVG_NS } from "../constants";
 | 
			
		||||
import { t } from "../i18n";
 | 
			
		||||
import { AppClassProperties, DataURL, BinaryFiles } from "../types";
 | 
			
		||||
import { isInitializedImageElement } from "./typeChecks";
 | 
			
		||||
import {
 | 
			
		||||
@@ -100,7 +99,7 @@ export const normalizeSVG = async (SVGString: string) => {
 | 
			
		||||
  const svg = doc.querySelector("svg");
 | 
			
		||||
  const errorNode = doc.querySelector("parsererror");
 | 
			
		||||
  if (errorNode || !isHTMLSVGElement(svg)) {
 | 
			
		||||
    throw new Error(t("errors.invalidSVGString"));
 | 
			
		||||
    throw new Error("Invalid SVG");
 | 
			
		||||
  } else {
 | 
			
		||||
    if (!svg.hasAttribute("xmlns")) {
 | 
			
		||||
      svg.setAttribute("xmlns", SVG_NS);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user