Skip to content

Commit

Permalink
fixed field reset on two people updating at once
Browse files Browse the repository at this point in the history
  • Loading branch information
thesuhas committed Oct 24, 2021
1 parent 924de7a commit 0331807
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/pages/loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class _LoadingState extends State<Loading> {
db.getCollection();
User? us;
us = await db.getData();
print('${us?.name} ${us?.team}');
if (us == null) {
showDialog<String>(
context: context,
Expand Down
2 changes: 1 addition & 1 deletion lib/services/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DatabaseService {
updateData(String field) async {
print(field);
var snapshot = await participantCollection.where('id', isEqualTo: this.id).get();
await snapshot.docs[0].reference.update({field: !snapshot.docs[0][field]});
await snapshot.docs[0].reference.update({field: true});
}
setupParticipant(String name, String team) async {
print('$name $team');
Expand Down

0 comments on commit 0331807

Please sign in to comment.