|
|
|
|
@ -435,7 +435,6 @@ class MarathonProvider extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool checkIfPrivilegedForMarathon() {
|
|
|
|
|
return true;
|
|
|
|
|
for (PrivilegeListModel element in AppState().privilegeListModel!) {
|
|
|
|
|
if (element.serviceName == "Marathon") {
|
|
|
|
|
if (element.previlege != null) {
|
|
|
|
|
@ -451,20 +450,18 @@ class MarathonProvider extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
isPrivilegedWithMarathon = checkIfPrivilegedForMarathon();
|
|
|
|
|
if (isPrivilegedWithMarathon) {
|
|
|
|
|
await MarathonApiClient().getMarathonToken().whenComplete(() async {
|
|
|
|
|
marathonDetailModel = await MarathonApiClient().getMarathonDetails();
|
|
|
|
|
updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30;
|
|
|
|
|
if (marathonDetailModel.id == null) {
|
|
|
|
|
isUpComingMarathon = false;
|
|
|
|
|
isLoading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) {
|
|
|
|
|
itsMarathonTime = false;
|
|
|
|
|
}
|
|
|
|
|
populateQuestionStatusesList();
|
|
|
|
|
});
|
|
|
|
|
marathonDetailModel = await MarathonApiClient().getMarathonDetails();
|
|
|
|
|
updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30;
|
|
|
|
|
if (marathonDetailModel.id == null) {
|
|
|
|
|
isUpComingMarathon = false;
|
|
|
|
|
isLoading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) {
|
|
|
|
|
itsMarathonTime = false;
|
|
|
|
|
}
|
|
|
|
|
populateQuestionStatusesList();
|
|
|
|
|
}
|
|
|
|
|
isLoading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|