Skip to content

Commit

Permalink
[PowerToys Run] Fix register notifications crash (#12911)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Aug 26, 2021
1 parent c1127b3 commit 078cf2c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/launcher/PowerLauncher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Windows;
using ManagedCommon;
using Microsoft.PowerToys.Common.UI;
Expand All @@ -16,6 +17,7 @@
using Windows.UI.Notifications;
using Wox.Infrastructure.Image;
using Wox.Plugin;
using Wox.Plugin.Logger;

namespace Wox
{
Expand All @@ -37,7 +39,14 @@ public PublicAPIInstance(SettingWindowViewModel settingsVM, MainViewModel mainVM
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());

DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
try
{
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
}
catch (System.UnauthorizedAccessException ex)
{
Log.Exception("Exception calling RegisterAumidAndComServer. Notifications not available.", ex, MethodBase.GetCurrentMethod().DeclaringType);
}
}

public void ChangeQuery(string query, bool requery = false)
Expand Down

0 comments on commit 078cf2c

Please sign in to comment.