mirror of
https://github.com/vladmandic/automatic
synced 2026-09-07 21:40:46 +02:00
optimize live preview
This commit is contained in:
@@ -116,6 +116,7 @@ function requestProgress(id_task, progressEl, galleryEl, atEnd = null, onProgres
|
||||
};
|
||||
|
||||
const start = (id_task, id_live_preview) => {
|
||||
console.log('HERE start', id_task, id_live_preview, opts.live_preview_refresh_period)
|
||||
request('./internal/progress', { id_task, id_live_preview }, (res) => {
|
||||
lastState = res;
|
||||
const elapsedFromStart = (new Date() - dateStart) / 1000;
|
||||
@@ -128,7 +129,7 @@ function requestProgress(id_task, progressEl, galleryEl, atEnd = null, onProgres
|
||||
if (res.live_preview && !livePreview) init();
|
||||
if (res.live_preview && galleryEl) img.src = res.live_preview;
|
||||
if (onProgress) onProgress(res);
|
||||
setTimeout(() => start(id_task, res.id_live_preview), opts.live_preview_refresh_period || 250);
|
||||
setTimeout(() => start(id_task, id_live_preview), opts.live_preview_refresh_period || 250);
|
||||
}, done);
|
||||
};
|
||||
start(id_task, 0);
|
||||
|
||||
Reference in New Issue
Block a user