From 2f52bc2aed118cb86aa7d0c8d9004ac8464072b7 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 26 Oct 2021 10:50:00 +0530 Subject: [PATCH] show compress thumbnail only if has large thumbnails and if no large thumbnail set state as completed --- src/components/FixLargeThumbnail.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/FixLargeThumbnail.tsx b/src/components/FixLargeThumbnail.tsx index 3db85a03a..08238182c 100644 --- a/src/components/FixLargeThumbnail.tsx +++ b/src/components/FixLargeThumbnail.tsx @@ -71,7 +71,10 @@ export default function FixLargeThumbnails(props: Props) { const main = async () => { const largeThumbnailFiles = await getLargeThumbnailFiles(); setLargeThumbnailFiles(largeThumbnailFiles ?? []); - if (fixState === FIX_STATE.NOT_STARTED) { + if ( + fixState === FIX_STATE.NOT_STARTED && + largeThumbnailFiles.length > 0 + ) { props.show(); } if ( @@ -81,6 +84,9 @@ export default function FixLargeThumbnails(props: Props) { updateFixState(FIX_STATE.NOT_STARTED); logError(Error(), 'large thumbnail files left after migration'); } + if (largeThumbnailFiles.length === 0) { + updateFixState(FIX_STATE.COMPLETED); + } }; useEffect(() => { if (props.isOpen && fixState !== FIX_STATE.RUNNING) {