fix: improve UI responsiveness during media file processing
This commit is contained in:
parent
0723623eaf
commit
181d3fca06
|
|
@ -62,6 +62,9 @@ export async function processMediaFiles(
|
||||||
aspectRatio,
|
aspectRatio,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Yield back to the event loop to keep the UI responsive
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
|
|
||||||
completed += 1;
|
completed += 1;
|
||||||
if (onProgress) {
|
if (onProgress) {
|
||||||
const percent = Math.round((completed / total) * 100);
|
const percent = Math.round((completed / total) * 100);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue