From 2d2a54c644647bbd98bdd22dd86a152f9ca428d3 Mon Sep 17 00:00:00 2001 From: Ionite Date: Sun, 28 Jan 2024 19:55:18 -0500 Subject: [PATCH] Fix notification init on macos --- .../Services/NotificationService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Services/NotificationService.cs b/StabilityMatrix.Avalonia/Services/NotificationService.cs index f82f1120..2c6b3da2 100644 --- a/StabilityMatrix.Avalonia/Services/NotificationService.cs +++ b/StabilityMatrix.Avalonia/Services/NotificationService.cs @@ -253,14 +253,20 @@ public class NotificationService(ILogger logger, ISettingsM { var context = WindowsApplicationContext.FromCurrentProcess("Stability Matrix"); nativeNotificationManager = new WindowsNotificationManager(context); + + await nativeNotificationManager.Initialize(); } else if (Compat.IsLinux) { var context = FreeDesktopApplicationContext.FromCurrentProcess(); nativeNotificationManager = new FreeDesktopNotificationManager(context); - } - await nativeNotificationManager!.Initialize(); + await nativeNotificationManager.Initialize(); + } + else + { + logger.LogInformation("Native notifications are not supported on this platform"); + } } catch (Exception e) {