From 2f9b19ddfcf481ef30cd797f9b4953c9a63390ca Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 25 Oct 2022 15:27:47 +0800 Subject: [PATCH] Fix 1356 --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 4 ++-- .../Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index cc368ab4b..bf1014c44 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -194,10 +194,10 @@ namespace Flow.Launcher.Plugin.Program { _uwps.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier) .Enabled = false; + _settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete)); var t1 = Task.Run(() => { IndexWin32Programs(); - _settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete)); _settings.LastIndexTime = DateTime.Today; }); } @@ -205,10 +205,10 @@ namespace Flow.Launcher.Plugin.Program { _win32s.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier) .Enabled = false; + _settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete)); var t1 = Task.Run(() => { IndexUwpPrograms(); - _settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete)); _settings.LastIndexTime = DateTime.Today; }); } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs index ff056ff13..c78c4fa9a 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs @@ -325,7 +325,8 @@ namespace Flow.Launcher.Plugin.Program.Views private static bool HasMoreOrEqualEnabledItems(List items) { - return items.Where(x => x.Enabled).Count() >= items.Count / 2; + var enableCount = items.Where(x => x.Enabled).Count(); + return enableCount >= items.Count - enableCount; } private void programSourceView_SelectionChanged(object sender, SelectionChangedEventArgs e)