From 17794a4677120f52dd8eba112aa30ede972e771a Mon Sep 17 00:00:00 2001 From: sagnikpal2004 Date: Wed, 8 Apr 2026 19:08:46 -0400 Subject: [PATCH 1/2] fix self API calls --- components/PanelPages/BlogEditorSection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/PanelPages/BlogEditorSection.tsx b/components/PanelPages/BlogEditorSection.tsx index 2cadf06..4f1f881 100644 --- a/components/PanelPages/BlogEditorSection.tsx +++ b/components/PanelPages/BlogEditorSection.tsx @@ -13,6 +13,7 @@ const normalizeUrl = (u: string) => { const t = u.trim() if (/^(https?:|data:|blob:)/i.test(t)) return t if (t.startsWith('//')) return `https:${t}` + if (t.startsWith('/')) return t return `https://${t.replace(/^\/+/, '')}` } @@ -1486,11 +1487,11 @@ const RichTextEditor: React.FC<{ setImageUrl('') }} onFileUpload={async (file) => { - setImageModalOpen(false) const permanentUrl = await uploadBlogImage(file) if (permanentUrl) { insertPlaceholder('image', permanentUrl) } + setImageModalOpen(false) }} onCancel={() => { setImageModalOpen(false); setImageUrl('') }} /> From 376a923753b827133ebfa9298eabbddaf1cf4325 Mon Sep 17 00:00:00 2001 From: sagnikpal2004 Date: Wed, 8 Apr 2026 19:22:07 -0400 Subject: [PATCH 2/2] set uploading state correctly --- components/PanelPages/BlogEditorSection.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/PanelPages/BlogEditorSection.tsx b/components/PanelPages/BlogEditorSection.tsx index 4f1f881..7c094ac 100644 --- a/components/PanelPages/BlogEditorSection.tsx +++ b/components/PanelPages/BlogEditorSection.tsx @@ -1610,11 +1610,12 @@ const InsertImageModal: React.FC<{ type="file" accept="image/*" className="hidden" - onChange={(e) => { + onChange={async (e) => { const file = e.target.files?.[0] if (file) { setUploading(true) - onFileUpload(file) + await onFileUpload(file) + setUploading(false) } }} />