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)