diff --git a/lib/src/screens/generator/generators/group_generator.dart b/lib/src/screens/generator/generators/group_generator.dart index 51b9622..043a5ad 100644 --- a/lib/src/screens/generator/generators/group_generator.dart +++ b/lib/src/screens/generator/generators/group_generator.dart @@ -168,7 +168,7 @@ class GroupBracketGenerator extends HookConsumerWidget { final repo = await ref.read(eventRepositoryProvider.future); for (final group in fights) { for (final round in group) { - for (final fight in round) { + await Future.wait(round.map((fight) { final blue = getTeam(fight[0]); final red = getTeam(fight[1]); final start = startTime.value.add( @@ -177,7 +177,7 @@ class GroupBracketGenerator extends HookConsumerWidget { (round.indexOf(fight) + (fights.indexOf(group) * round.length)), ); - await repo.createFight( + return repo.createFight( event.event.id, start, gamemode.value!, @@ -186,10 +186,9 @@ class GroupBracketGenerator extends HookConsumerWidget { red, 0, "Gruppe ${fights.indexOf(group) + 1}"); - } + })); } } - context.go("/events/${event.event.id}"); } : null, label: const Text("Generate")),