Parcourir la source

Fix builds on macOS versions pre-11

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Claudio Cambra il y a 3 ans
Parent
commit
4bdfe59270
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      src/gui/systray.mm

+ 5 - 1
src/gui/systray.mm

@@ -18,7 +18,11 @@ Q_LOGGING_CATEGORY(lcMacSystray, "nextcloud.gui.macsystray")
     willPresentNotification:(UNNotification *)notification
     withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
 {
-    completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBanner);
+    if (@available(macOS 11.0, *)) {
+        completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBanner);
+    } else {
+        completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionAlert);
+    }
 }
 
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center