fix: improve UI responsiveness during media file processing
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user