From 7d0c5598a0102eceebe78dd55b4df8d1632fe985 Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Mon, 20 Feb 2023 17:23:52 +0300 Subject: [PATCH] QuickFix --- lib/ui/marathon/marathon_provider.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ui/marathon/marathon_provider.dart b/lib/ui/marathon/marathon_provider.dart index 65b9353..908a8c0 100644 --- a/lib/ui/marathon/marathon_provider.dart +++ b/lib/ui/marathon/marathon_provider.dart @@ -279,8 +279,8 @@ class MarathonProvider extends ChangeNotifier { oneSec, (Timer timer) async { if (totalSecondsToWaitForWinner == 1) { - await callGetSelectedWinnersApi().whenComplete(() => updateQuestionCardStatus(QuestionCardStatus.winnerFound)); timer.cancel(); + await callGetSelectedWinnersApi().whenComplete(() => updateQuestionCardStatus(QuestionCardStatus.winnerFound)); return; } else if (totalSecondsToWaitForWinner == 15) { totalSecondsToWaitForWinner--; @@ -353,12 +353,15 @@ class MarathonProvider extends ChangeNotifier { gapTimeImage = currentQuestion.gapImage; gapTimeText = currentQuestion.gapText; gapTimeType = currentQuestion.gapType; + + startTimerForQuestion(); + updateCardData(); if (Utils.isLoading) { Utils.hideLoading(AppRoutes.navigatorKey.currentContext!); } - startTimerForQuestion(); - updateCardData(); - totalMarathoners = await MarathonApiClient().getMarathonersCount(marathonId: marathonDetailModel.id!); + if (!AppState().getIsDemoMarathon) { + totalMarathoners = await MarathonApiClient().getMarathonersCount(marathonId: marathonDetailModel.id!); + } Navigator.pushReplacementNamed(AppRoutes.navigatorKey.currentContext!, AppRoutes.marathonScreen); } else { currentQuestion = AppState().getIsDemoMarathon