basic progress toasts

ref #62
This commit is contained in:
2021-02-20 17:19:17 +01:00
parent dbc0ab76af
commit a7642c2da4
7 changed files with 70 additions and 1 deletions

View File

@@ -50,7 +50,13 @@
on:click={async () => {
const locale = getLocaleFromNavigator();
const teams = current_teams.filter((r) => r.is_selected === true);
const toast = Toastify({
text: $_('generating-pdfs'),
duration: -1,
}).showToast();
let count = 0;
for await (const t of teams) {
count++;
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(t.id);
fetch(
`https://dev.lauf-fuer-kaya.de/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
@@ -71,6 +77,15 @@
document.body.appendChild(a);
a.click();
a.remove();
if (count === teams.length) {
toast.hideToast();
Toastify({
text: $_('pdfs-successfully-generated'),
duration: 3500,
backgroundColor:
'linear-gradient(to right, #00b09b, #96c93d)',
}).showToast();
}
})
.catch((err) => {});
}