From 51ddfd97f061a9cddc86df90a62735b7ea10c358 Mon Sep 17 00:00:00 2001 From: Neil McAlister Date: Sat, 27 Jan 2018 12:42:14 +0200 Subject: [PATCH] Make alerts EVEN less crashy --- Trippit/ViewModels/MainViewModel.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Trippit/ViewModels/MainViewModel.cs b/Trippit/ViewModels/MainViewModel.cs index 994253f..9db954b 100644 --- a/Trippit/ViewModels/MainViewModel.cs +++ b/Trippit/ViewModels/MainViewModel.cs @@ -105,8 +105,7 @@ private async Task UpdateAlerts() { List newAlerts = response .Result - .Distinct(_transitTrafficAlertComparer) // Sometimes we get a bunch of duplicate alerts that have different IDs, but no other difference - .Where(x => !String.IsNullOrWhiteSpace(x.DescriptionText?.Text)) // or empty alerts + .Distinct(_transitTrafficAlertComparer) .OrderBy(x => x.StartDate) .ToList(); AreAlertsFresh = newAlerts.Any(newAlert => TrafficAlerts.All(oldAlert => oldAlert.Id != newAlert.Id)); @@ -148,22 +147,12 @@ internal class TransitTrafficAlertComparer : IEqualityComparer