Opera10 commited on
Commit
1bc0471
·
verified ·
1 Parent(s): 5e86926

Update App.tsx

Browse files
Files changed (1) hide show
  1. App.tsx +15 -6
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
- const updatedJob = { ...job, enhancement: { ...enh, status: statusRes.status, progress: nextProgress, filename: statusRes.filename || enh.filename } };
265
- updates[job.job_id] = updatedJob;
266
- hasChanges = true;
267
- db.saveJob(updatedJob);
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 }));