Bläddra i källkod

Merge pull request #4563 from nextcloud/bugfix/pre-bigsur-build-fix

Fix build on macOS versions pre-11 (down to 10.14)
Claudio Cambra 3 år sedan
förälder
incheckning
87ebd3ff3b
1 ändrade filer med 5 tillägg och 1 borttagningar
  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