Optimize Create Fight
Dieser Commit ist enthalten in:
Ursprung
f1f3c5f610
Commit
346a3b9a46
@ -168,7 +168,7 @@ class GroupBracketGenerator extends HookConsumerWidget {
|
|||||||
final repo = await ref.read(eventRepositoryProvider.future);
|
final repo = await ref.read(eventRepositoryProvider.future);
|
||||||
for (final group in fights) {
|
for (final group in fights) {
|
||||||
for (final round in group) {
|
for (final round in group) {
|
||||||
for (final fight in round) {
|
await Future.wait(round.map((fight) {
|
||||||
final blue = getTeam(fight[0]);
|
final blue = getTeam(fight[0]);
|
||||||
final red = getTeam(fight[1]);
|
final red = getTeam(fight[1]);
|
||||||
final start = startTime.value.add(
|
final start = startTime.value.add(
|
||||||
@ -177,7 +177,7 @@ class GroupBracketGenerator extends HookConsumerWidget {
|
|||||||
(round.indexOf(fight) +
|
(round.indexOf(fight) +
|
||||||
(fights.indexOf(group) * round.length)),
|
(fights.indexOf(group) * round.length)),
|
||||||
);
|
);
|
||||||
await repo.createFight(
|
return repo.createFight(
|
||||||
event.event.id,
|
event.event.id,
|
||||||
start,
|
start,
|
||||||
gamemode.value!,
|
gamemode.value!,
|
||||||
@ -186,11 +186,10 @@ class GroupBracketGenerator extends HookConsumerWidget {
|
|||||||
red,
|
red,
|
||||||
0,
|
0,
|
||||||
"Gruppe ${fights.indexOf(group) + 1}");
|
"Gruppe ${fights.indexOf(group) + 1}");
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.go("/events/${event.event.id}");
|
|
||||||
}
|
|
||||||
: null,
|
: null,
|
||||||
label: const Text("Generate")),
|
label: const Text("Generate")),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren