This commit is contained in:
Vic 2022-10-25 15:27:47 +08:00
parent 0a19b02792
commit 2f9b19ddfc
2 changed files with 4 additions and 3 deletions

View file

@ -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;
});
}

View file

@ -325,7 +325,8 @@ namespace Flow.Launcher.Plugin.Program.Views
private static bool HasMoreOrEqualEnabledItems(List<ProgramSource> 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)