|  |  |  | @ -10,6 +10,7 @@ import 'package:mohem_flutter_app/app_state/app_state.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/consts.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/utils.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/config/routes.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/marathon/marathon_generic_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/marathon/marathon_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/marathon/question_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/marathon/winner_model.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -193,9 +194,7 @@ class MarathonProvider extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |         if (totalSecondsToWaitForMarathon == 0) { | 
		
	
		
			
				|  |  |  |  |           timer.cancel(); | 
		
	
		
			
				|  |  |  |  |           if (isUserWaiting) { | 
		
	
		
			
				|  |  |  |  |             MarathonApiClient().joinMarathonAsParticipant().whenComplete(() async { | 
		
	
		
			
				|  |  |  |  |               await callNextQuestionApi(); | 
		
	
		
			
				|  |  |  |  |             }); | 
		
	
		
			
				|  |  |  |  |             await callNextQuestionApi(); | 
		
	
		
			
				|  |  |  |  |           } else { | 
		
	
		
			
				|  |  |  |  |             isButtonEnabled = false; | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
	
		
			
				
					|  |  |  | @ -575,9 +574,18 @@ class MarathonProvider extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> onJoinMarathonPressed(BuildContext context) async { | 
		
	
		
			
				|  |  |  |  |     try { | 
		
	
		
			
				|  |  |  |  |       isUserWaiting = true; | 
		
	
		
			
				|  |  |  |  |       Navigator.pushReplacementNamed(context, AppRoutes.marathonWaitingScreen); | 
		
	
		
			
				|  |  |  |  |       Utils.showLoading(AppRoutes.navigatorKey.currentContext!); | 
		
	
		
			
				|  |  |  |  |       MarathonApiClient().joinMarathonAsParticipant().then((MarathonGenericModel? marathonGenericModel) async { | 
		
	
		
			
				|  |  |  |  |         Utils.hideLoading(AppRoutes.navigatorKey.currentContext!); | 
		
	
		
			
				|  |  |  |  |         if (marathonGenericModel != null && marathonGenericModel.data != null) { | 
		
	
		
			
				|  |  |  |  |           isUserWaiting = true; | 
		
	
		
			
				|  |  |  |  |           Navigator.pushReplacementNamed(context, AppRoutes.marathonWaitingScreen); | 
		
	
		
			
				|  |  |  |  |         } else if (marathonGenericModel!.data == null) { | 
		
	
		
			
				|  |  |  |  |           Utils.showToast(marathonGenericModel.message.toString()); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
		
			
				|  |  |  |  |     } catch (e) { | 
		
	
		
			
				|  |  |  |  |       Utils.hideLoading(AppRoutes.navigatorKey.currentContext!); | 
		
	
		
			
				|  |  |  |  |       Utils.confirmDialog(context, e.toString()); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
	
		
			
				
					|  |  |  | 
 |