public static async Task TryUpdateLocationsTravelInfoAsync()

in LocationHelper/LocationHelper.cs [183:206]


        public static async Task<bool> TryUpdateLocationsTravelInfoAsync(IEnumerable<LocationData> locations, LocationData currentLocation)
        {
            try
            {
                await Task.WhenAll(locations.Select(async location =>
                {
                    await LocationHelper.UpdateTravelInfoAsync(location, currentLocation);

                    int travelTimeDifference = location.CurrentTravelTime - location.CurrentTravelTimeWithoutTraffic;

                    if (location.IsMonitored && travelTimeDifference >= 10)
                    {
                        LocationHelper.ShowToast(
                            $"+{travelTimeDifference} min. to {location.Name}, total {location.CurrentTravelTime} min.");
                    }
                }));
                return true;
            }
            catch (Exception ex) when (ex.Message.Equals(routeFinderUnavailableMessage))
            {
                return false;
            }

        }