Skip to content

Commit

Permalink
MPR Fix preview icon was not selected when uploading only one image
Browse files Browse the repository at this point in the history
Fix preview icon was not selected when uploading only one image
  • Loading branch information
pkong-ds authored Aug 22, 2024
2 parents 402a924 + fe0d877 commit e6f035c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/scripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e6f035c

Please sign in to comment.