Updated route controller to go through every response from the server to avoid missing a key item

This commit is contained in:
Luke Else 2022-01-31 14:29:09 +00:00
parent 9e00882743
commit f0da93cdae

View File

@ -134,14 +134,15 @@ namespace EFB.Controllers
ResponseModel<List<PollResponse>> responsePoll = await pollingRequest; ResponseModel<List<PollResponse>> responsePoll = await pollingRequest;
foreach (var item in responsePoll.Result)
int routePos = responsePoll.Result.Count - 1; {
if (responsePoll.Result[routePos].Command == "solution") if (item.Command == "fpl" || item.Command == "solution")
{ {
collected = true; collected = true;
routeString = responsePoll.Result[routePos].FlightPlan; routeString = item.FlightPlan;
break; break;
} }
}
Thread.Sleep(3000); Thread.Sleep(3000);
pollCount++; pollCount++;