mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use lazy init after version check
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
bb946b707a
commit
2eeb097194
1 changed files with 2 additions and 1 deletions
|
|
@ -290,12 +290,13 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Channel<byte> PackageChangeChannel = Channel.CreateBounded<byte>(1);
|
private static readonly Channel<byte> PackageChangeChannel = Channel.CreateBounded<byte>(1);
|
||||||
private static PackageCatalog catalog = PackageCatalog.OpenForCurrentUser();
|
private static PackageCatalog? catalog;
|
||||||
|
|
||||||
public static async Task WatchPackageChangeAsync()
|
public static async Task WatchPackageChangeAsync()
|
||||||
{
|
{
|
||||||
if (Environment.OSVersion.Version.Major >= 10)
|
if (Environment.OSVersion.Version.Major >= 10)
|
||||||
{
|
{
|
||||||
|
catalog ??= PackageCatalog.OpenForCurrentUser();
|
||||||
catalog.PackageInstalling += (_, args) =>
|
catalog.PackageInstalling += (_, args) =>
|
||||||
{
|
{
|
||||||
if (args.IsComplete)
|
if (args.IsComplete)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue