show compress thumbnail only if has large thumbnails and if no large thumbnail set state as completed
This commit is contained in:
parent
565f871a3d
commit
2f52bc2aed
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue