Spaces:
Sleeping
Sleeping
Update App.tsx
Browse files
App.tsx
CHANGED
|
@@ -260,12 +260,21 @@ export default function App() {
|
|
| 260 |
if (statusRes.status === 'completed') nextProgress = 100;
|
| 261 |
else nextProgress = Math.min(95, nextProgress + 1);
|
| 262 |
|
| 263 |
-
if (statusRes.status !== enh.status || nextProgress !== enh.progress) {
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
} catch (err) { console.error(err); }
|
| 270 |
}));
|
| 271 |
if (hasChanges) setJobs(prev => ({ ...prev, ...updates }));
|
|
|
|
| 260 |
if (statusRes.status === 'completed') nextProgress = 100;
|
| 261 |
else nextProgress = Math.min(95, nextProgress + 1);
|
| 262 |
|
| 263 |
+
if (statusRes.status !== enh.status || nextProgress !== enh.progress || statusRes.downloadUrl !== enh.downloadUrl) {
|
| 264 |
+
const updatedJob = {
|
| 265 |
+
...job,
|
| 266 |
+
enhancement: {
|
| 267 |
+
...enh,
|
| 268 |
+
status: statusRes.status,
|
| 269 |
+
progress: nextProgress,
|
| 270 |
+
filename: statusRes.filename || enh.filename,
|
| 271 |
+
downloadUrl: statusRes.downloadUrl || enh.downloadUrl // ذخیره آدرس مستقیم بله در مرورگر کاربر برای مقاومت در برابر ریاستارت
|
| 272 |
+
}
|
| 273 |
+
};
|
| 274 |
+
updates[job.job_id] = updatedJob;
|
| 275 |
+
hasChanges = true;
|
| 276 |
+
db.saveJob(updatedJob);
|
| 277 |
+
}
|
| 278 |
} catch (err) { console.error(err); }
|
| 279 |
}));
|
| 280 |
if (hasChanges) setJobs(prev => ({ ...prev, ...updates }));
|