diff --git a/Controllers/RouteController.cs b/Controllers/RouteController.cs index ba0281a..78da5c6 100644 --- a/Controllers/RouteController.cs +++ b/Controllers/RouteController.cs @@ -100,5 +100,26 @@ namespace EFB.Controllers } return RedirectToAction("Index", "Home"); } + + + public async Task Poll(){ + if (HttpContext.Session.GetString("User") != null) + {//If the user is currently logged in + UserModel User = HttpContext.Session.GetObject("User"); + + if (User.Route != null) + {//If the user has a route object (e.g, they have been to the route page) + + //Make calls to the server to fetch route + return RedirectToAction("Index", "Route"); + + }else{ + return RedirectToAction("Index", "Route"); + } + + }else{ + return RedirectToAction("Index", "Route"); + } + } } } \ No newline at end of file diff --git a/Models/UserModel.cs b/Models/UserModel.cs index e4e2dce..500b82e 100644 --- a/Models/UserModel.cs +++ b/Models/UserModel.cs @@ -21,7 +21,7 @@ namespace EFB.Models public TokenModel Token { get; set; } = null; //Contains the most recent route generated by the user through the App - public object Route { get; set; } = null; + public RouteModel Route { get; set; } = null; //Contains the most recently stored position of the user in the simulator public object SimPosition { get; set; } = null;