From ac945f48147c8901861bb1ed9f2c9d2d7966e044 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 27 Nov 2020 07:04:39 +1100 Subject: [PATCH] revert unneeded condition on Constant.MissingImgIcon --- Flow.Launcher.Infrastructure/Image/ImageCache.cs | 5 +---- Flow.Launcher/ViewModel/ResultViewModel.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageCache.cs b/Flow.Launcher.Infrastructure/Image/ImageCache.cs index 3c819236b..0cb5779d2 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageCache.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageCache.cs @@ -66,10 +66,7 @@ namespace Flow.Launcher.Infrastructure.Image { // To delete the images from the data dictionary based on the resizing of the Usage Dictionary. - foreach (var key in Data.Where(x => x.Key != Constant.MissingImgIcon) - .OrderBy(x => x.Value.usage) - .Take(Data.Count - MaxCached) - .Select(x => x.Key)) + foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key)) { if (!(key.Equals(Constant.ErrorIcon) || key.Equals(Constant.DefaultIcon))) { diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 6e00d3421..00a0e1ae5 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -53,10 +53,14 @@ namespace Flow.Launcher.ViewModel if (result != null) { Result = result; - Image = new LazyAsync(SetImage, ImageLoader.DefaultImage, () => - { - OnPropertyChanged(nameof(Image)); - }); + + Image = new LazyAsync( + SetImage, + ImageLoader.DefaultImage, + () => + { + OnPropertyChanged(nameof(Image)); + }); } Settings = settings;