Skip to content

Commit

Permalink
Fixed double entry bug when clicking safe homework button again after…
Browse files Browse the repository at this point in the history
… uploading (#1699)

Fixed bug #1117 and fixed some grammar mistakes in CONTRIBUTING.md

---------

Co-authored-by: Jonas Sander <[email protected]>
  • Loading branch information
HumanBot000 and Jonas-Sander authored Aug 10, 2024
1 parent 00f14b3 commit 44e8401
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/lib/homework/homework_dialog/homework_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,19 @@ class _SaveButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
return SaveButton(
key: HwDialogKeys.saveButton,
tooltip: "Hausaufgabe speichern",
onPressed: () => onPressed(context),
);
bool isSaving = false;
return StatefulBuilder(builder: (context, setState) {
return SaveButton(
key: HwDialogKeys.saveButton,
tooltip: "Hausaufgabe speichern",
onPressed: isSaving
? null
: () {
setState(() => isSaving = true);
onPressed(context);
},
);
});
}
}

Expand Down

0 comments on commit 44e8401

Please sign in to comment.