From 099021b186874c66be267585278fdc5f385a9de0 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:50:34 +0800 Subject: [PATCH] Save programs cache after indexing --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 340d882da..c847982a2 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -110,6 +110,8 @@ namespace Flow.Launcher.Plugin.Program var win32S = Win32.All(_settings); _win32s = win32S; ResetCache(); + _win32Storage.Save(_win32s); + _settings.LastIndexTime = DateTime.Now; } public static void IndexUwpPrograms() @@ -117,6 +119,8 @@ namespace Flow.Launcher.Plugin.Program var applications = UWP.All(_settings); _uwps = applications; ResetCache(); + _uwpStorage.Save(_uwps); + _settings.LastIndexTime = DateTime.Now; } public static async Task IndexProgramsAsync() @@ -131,7 +135,6 @@ namespace Flow.Launcher.Plugin.Program Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms); }); await Task.WhenAll(a, b).ConfigureAwait(false); - _settings.LastIndexTime = DateTime.Today; } internal static void ResetCache() @@ -199,7 +202,6 @@ namespace Flow.Launcher.Plugin.Program _ = Task.Run(() => { IndexUwpPrograms(); - _settings.LastIndexTime = DateTime.Today; }); } else if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)) @@ -210,7 +212,6 @@ namespace Flow.Launcher.Plugin.Program _ = Task.Run(() => { IndexWin32Programs(); - _settings.LastIndexTime = DateTime.Today; }); } }