add statistics reload and fix wrong best player calculation
This commit is contained in:
@@ -191,7 +191,13 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
||||
context,
|
||||
adaptivePageRoute(
|
||||
builder: (context) {
|
||||
return CreateGroupView(groupToEdit: _group);
|
||||
return CreateGroupView(
|
||||
groupToEdit: _group,
|
||||
onMembersChanged: () {
|
||||
isLoading = true;
|
||||
_loadStatistics();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -260,7 +266,9 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
||||
|
||||
// Count wins for each player
|
||||
for (var match in matches) {
|
||||
if (match.winner != null) {
|
||||
if (match.winner != null &&
|
||||
_group.members.any((m) => m.id == match.winner?.id)) {
|
||||
print(match.winner);
|
||||
bestPlayerCounts.update(
|
||||
match.winner!,
|
||||
(value) => value + 1,
|
||||
|
||||
Reference in New Issue
Block a user