Skip to content

Commit

Permalink
Update ModelSelect.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kiloking committed Jan 12, 2024
1 parent 674cd2d commit 812f662
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Page/Camera/ModelSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ function ModelSelect() {
img: '',
finished: 0,
}));
let counterIndex = 0
const uploadPromises = imageUrls.map((imageUrl,index) => {
return new Promise(async (resolve, reject) => {
try {
Expand All @@ -182,13 +183,19 @@ function ModelSelect() {
}

const responseData = await response.json();

console.log(responseData);


if (responseData.message) {
setMsg('Error:please upload the image again.')
reject(new Error('Image upload failed.'));
return;
}
if(responseData.id){
counterIndex++
setMsg(`Flow task ${counterIndex}/${imageUrls.length} uploaded`)
}

// 上传成功,等待结果
await new Promise((innerResolve) => setTimeout(innerResolve, 300));
Expand Down

0 comments on commit 812f662

Please sign in to comment.