diff --git a/src/main.rs b/src/main.rs index d124d0b..8c4290c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -663,18 +663,26 @@ if (importAllForm) { if (button) button.disabled = true; let done = 0; - for (const row of rows) { - const ok = await importActivity( - row.dataset.athleteId, - row.dataset.activityId, - row - ); - if (ok) done += 1; + const updateLabel = () => { if (button) { button.textContent = 'Importiere … (' + done + '/' + rows.length + ')'; } - } + }; + updateLabel(); + + await Promise.allSettled( + rows.map((row) => + importActivity( + row.dataset.athleteId, + row.dataset.activityId, + row + ).then((ok) => { + if (ok) done += 1; + updateLabel(); + }) + ) + ); if (button) { button.textContent =