Skip to content

Commit

Permalink
Fixed a massive oversight in the endgame timer
Browse files Browse the repository at this point in the history
If the user did not do anything, the timer would not save the time

Thanks to Aiden for finding this bug
  • Loading branch information
awtpi314 committed Mar 4, 2022
1 parent b5ff151 commit 65d5cc6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/stopwatch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class _StopwatchTimerWidgetState extends State<StopwatchTimerWidget> {
Timer? timer;
Stopwatch watchTimer = Stopwatch();
bool addInitialTime = true;
bool firstRun = true;

@override
void dispose() {
Expand Down Expand Up @@ -75,6 +76,13 @@ class _StopwatchTimerWidgetState extends State<StopwatchTimerWidget> {

@override
Widget build(BuildContext context) {
if (firstRun) {
firstRun = !firstRun;
matchData[widget.stageName] ??= {};
matchData[widget.stageName]![widget.title] =
Tuple2<int, String>(widget.positionOnStack, "0.0");
}

return Padding(
padding: const EdgeInsets.all(20),
child: Center(
Expand Down

0 comments on commit 65d5cc6

Please sign in to comment.