From 06a1428cbc084d176fb5a1d9d07fa84f26caba10 Mon Sep 17 00:00:00 2001
From: Salihu <91833785+salihudickson@users.noreply.github.com>
Date: Sat, 4 Oct 2025 12:48:06 +0100
Subject: [PATCH] fix CORS err on img download (#10279)
* fix CORS err on img download
* add check to prevent accidental double download
* disable download button when downloading
---
shared/editor/components/Image.tsx | 26 +++++++-
shared/editor/nodes/Image.tsx | 103 ++++++++++++++++++-----------
2 files changed, 87 insertions(+), 42 deletions(-)
diff --git a/shared/editor/components/Image.tsx b/shared/editor/components/Image.tsx
index d8306ba1e5..b8ae529d4d 100644
--- a/shared/editor/components/Image.tsx
+++ b/shared/editor/components/Image.tsx
@@ -21,10 +21,12 @@ type Props = ComponentProps & {
/** The editor view */
view: EditorView;
children?: React.ReactElement;
+ isDownloading?: boolean;
};
const Image = (props: Props) => {
- const { isSelected, node, isEditable, onChangeSize, onClick } = props;
+ const { isSelected, node, isEditable, onChangeSize, onClick, isDownloading } =
+ props;
const { src, layoutClass } = node.attrs;
const { t } = useTranslation();
const className = layoutClass ? `image image-${layoutClass}` : "image";
@@ -102,7 +104,11 @@ const Image = (props: Props) => {
)}
-