From 369fec8e8efa3822d9b0fda3121e37208d8fa258 Mon Sep 17 00:00:00 2001 From: "Schwinghammer, Max" Date: Mon, 10 Jun 2024 15:10:24 +0200 Subject: [PATCH] Fixed missing image if image upload is cancelled --- .../scenes/Home/components/create-post/ImageUpload.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/web/src/scenes/Home/components/create-post/ImageUpload.tsx b/src/main/web/src/scenes/Home/components/create-post/ImageUpload.tsx index a9b41d53..8917c01c 100644 --- a/src/main/web/src/scenes/Home/components/create-post/ImageUpload.tsx +++ b/src/main/web/src/scenes/Home/components/create-post/ImageUpload.tsx @@ -15,6 +15,11 @@ export const ImageUpload: React.FC = (props: ImageUploadProps) const onChange = (imageList: ImageType[]): void => { setImages(imageList); onImagesChange?.(imageList); + if (imageList.length > 0) { + setShowButton(false); + } else { + setShowButton(true); + } }; return ( @@ -27,10 +32,6 @@ export const ImageUpload: React.FC = (props: ImageUploadProps)