From cafe3153366f915679b3cf773ab824825e52e364 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 5 Jul 2024 16:42:53 +0800 Subject: [PATCH] fix: resolve potential exception during bulk image upload in post creation Signed-off-by: Ryan Wang --- ui/console-src/modules/contents/pages/SinglePageEditor.vue | 3 --- ui/console-src/modules/contents/posts/PostEditor.vue | 4 ---- ui/uc-src/modules/contents/posts/PostEditor.vue | 3 --- 3 files changed, 10 deletions(-) diff --git a/ui/console-src/modules/contents/pages/SinglePageEditor.vue b/ui/console-src/modules/contents/pages/SinglePageEditor.vue index 3f217e99cd..6287f2e5ce 100644 --- a/ui/console-src/modules/contents/pages/SinglePageEditor.vue +++ b/ui/console-src/modules/contents/pages/SinglePageEditor.vue @@ -431,9 +431,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) { if (!currentUserHasPermission(["uc:attachments:manage"])) { return; } - if (!isUpdateMode.value) { - await handleSave(); - } const { data } = await ucApiClient.storage.attachment.createAttachmentForPost( { diff --git a/ui/console-src/modules/contents/posts/PostEditor.vue b/ui/console-src/modules/contents/posts/PostEditor.vue index 17cc5cb019..f55527c48c 100644 --- a/ui/console-src/modules/contents/posts/PostEditor.vue +++ b/ui/console-src/modules/contents/posts/PostEditor.vue @@ -456,10 +456,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) { return; } - if (!isUpdateMode.value) { - await handleSave(); - } - const { data } = await ucApiClient.storage.attachment.createAttachmentForPost( { file, diff --git a/ui/uc-src/modules/contents/posts/PostEditor.vue b/ui/uc-src/modules/contents/posts/PostEditor.vue index 1de04b98da..50f4524a6b 100644 --- a/ui/uc-src/modules/contents/posts/PostEditor.vue +++ b/ui/uc-src/modules/contents/posts/PostEditor.vue @@ -422,9 +422,6 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) { if (!currentUserHasPermission(["uc:attachments:manage"])) { return; } - if (!isUpdateMode.value) { - await handleCreate(); - } const { data } = await ucApiClient.storage.attachment.createAttachmentForPost( {