Browse Source

Fix notification init on macos

pull/438/head
Ionite 10 months ago
parent
commit
2d2a54c644
No known key found for this signature in database
  1. 10
      StabilityMatrix.Avalonia/Services/NotificationService.cs

10
StabilityMatrix.Avalonia/Services/NotificationService.cs

@ -253,14 +253,20 @@ public class NotificationService(ILogger<NotificationService> logger, ISettingsM
{ {
var context = WindowsApplicationContext.FromCurrentProcess("Stability Matrix"); var context = WindowsApplicationContext.FromCurrentProcess("Stability Matrix");
nativeNotificationManager = new WindowsNotificationManager(context); nativeNotificationManager = new WindowsNotificationManager(context);
await nativeNotificationManager.Initialize();
} }
else if (Compat.IsLinux) else if (Compat.IsLinux)
{ {
var context = FreeDesktopApplicationContext.FromCurrentProcess(); var context = FreeDesktopApplicationContext.FromCurrentProcess();
nativeNotificationManager = new FreeDesktopNotificationManager(context); nativeNotificationManager = new FreeDesktopNotificationManager(context);
}
await nativeNotificationManager!.Initialize(); await nativeNotificationManager.Initialize();
}
else
{
logger.LogInformation("Native notifications are not supported on this platform");
}
} }
catch (Exception e) catch (Exception e)
{ {

Loading…
Cancel
Save