From 4ab687c58841cd187d0d838c885ea3f2d46bb4c1 Mon Sep 17 00:00:00 2001 From: ledouxm Date: Tue, 22 Oct 2024 13:28:18 +0200 Subject: [PATCH] fix: initial pic status --- packages/frontend/src/features/InfoForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/features/InfoForm.tsx b/packages/frontend/src/features/InfoForm.tsx index 62de2c0..429f723 100644 --- a/packages/frontend/src/features/InfoForm.tsx +++ b/packages/frontend/src/features/InfoForm.tsx @@ -373,12 +373,12 @@ const PictureThumbnail = ({ picture, index, status }: { picture: Pictures; index queryKey: ["picture-status", picture.id], queryFn: async () => { const status = await get(picture.id, getUploadStatusStore()); - return status; + return status ?? null; }, enabled: !status, }); - const finalStatus = status ?? idbStatusQuery.data ?? "success"; + const finalStatus = picture.url ? "success" : status ?? idbStatusQuery.data ?? "uploading"; const bgUrl = bgUrlQuery.data;