diff --git a/public/scripts/upload.js b/public/scripts/upload.js index 28e47a5..d70ad3d 100644 --- a/public/scripts/upload.js +++ b/public/scripts/upload.js @@ -164,15 +164,15 @@ class FileListViewModel { await imageUpload.read(); imageUpload.ulid = ULID.ulid(); + if (window.viewModel.selectedPreviewImageULID === null && i === 0) { + window.viewModel.selectedPreviewImageULID = imageUpload.ulid; + } // Avoiding read same image file setTimeout(() => { this._imageUploads.push(imageUpload); window.viewModel.generatePreviewMockup(imageUpload); }, i * 10); } - - window.viewModel.selectedPreviewImageULID = - window.viewModel.defaultImageUploadULID; } async remove(filename, fileUlid) {