Skip to content

Commit 6be4731

Browse files
jjw24TBM13
authored andcommitted
Merge pull request Flow-Launcher#3821 from Flow-Launcher/fix-uwp-package-monitoring
Fix the issue that UWP changes that can't be monitored (Flow-Launcher#2345)
1 parent 7b3ebf4 commit 6be4731

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,13 @@ private static IEnumerable<Package> CurrentUserPackages()
288288
}
289289

290290
private static readonly Channel<byte> PackageChangeChannel = Channel.CreateBounded<byte>(1);
291+
private static PackageCatalog? catalog;
291292

292293
public static async Task WatchPackageChangeAsync()
293294
{
294295
if (Environment.OSVersion.Version.Major >= 10)
295296
{
296-
var catalog = PackageCatalog.OpenForCurrentUser();
297+
catalog ??= PackageCatalog.OpenForCurrentUser();
297298
catalog.PackageInstalling += (_, args) =>
298299
{
299300
if (args.IsComplete)

0 commit comments

Comments
 (0)