Skip to content

Commit 099021b

Browse files
Save programs cache after indexing
1 parent 59b9cd8 commit 099021b

File tree

1 file changed

+4
-3
lines changed
  • Plugins/Flow.Launcher.Plugin.Program

1 file changed

+4
-3
lines changed

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@ public static void IndexWin32Programs()
110110
var win32S = Win32.All(_settings);
111111
_win32s = win32S;
112112
ResetCache();
113+
_win32Storage.Save(_win32s);
114+
_settings.LastIndexTime = DateTime.Now;
113115
}
114116

115117
public static void IndexUwpPrograms()
116118
{
117119
var applications = UWP.All(_settings);
118120
_uwps = applications;
119121
ResetCache();
122+
_uwpStorage.Save(_uwps);
123+
_settings.LastIndexTime = DateTime.Now;
120124
}
121125

122126
public static async Task IndexProgramsAsync()
@@ -131,7 +135,6 @@ public static async Task IndexProgramsAsync()
131135
Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms);
132136
});
133137
await Task.WhenAll(a, b).ConfigureAwait(false);
134-
_settings.LastIndexTime = DateTime.Today;
135138
}
136139

137140
internal static void ResetCache()
@@ -199,7 +202,6 @@ private static void DisableProgram(IProgram programToDelete)
199202
_ = Task.Run(() =>
200203
{
201204
IndexUwpPrograms();
202-
_settings.LastIndexTime = DateTime.Today;
203205
});
204206
}
205207
else if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
@@ -210,7 +212,6 @@ private static void DisableProgram(IProgram programToDelete)
210212
_ = Task.Run(() =>
211213
{
212214
IndexWin32Programs();
213-
_settings.LastIndexTime = DateTime.Today;
214215
});
215216
}
216217
}

0 commit comments

Comments
 (0)