Use preprocessor directive rather than normal 'if' for UNNotification types
authorClaudio Cambra <claudio.cambra@gmail.com>
Tue, 12 Jul 2022 09:11:44 +0000 (11:11 +0200)
committerClaudio Cambra <claudio.cambra@gmail.com>
Fri, 15 Jul 2022 14:21:16 +0000 (16:21 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
src/gui/systray.mm

index 516b4636e04b9e5afa90e957fb51bf8c5da3fed1..8798e125e2672dd1e1ae3f1ee272a2865251d2d8 100644 (file)
@@ -18,11 +18,11 @@ Q_LOGGING_CATEGORY(lcMacSystray, "nextcloud.gui.macsystray")
     willPresentNotification:(UNNotification *)notification
     withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
 {
-    if (@available(macOS 11.0, *)) {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
         completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBanner);
-    } else {
+#else
         completionHandler(UNNotificationPresentationOptionSound + UNNotificationPresentationOptionAlert);
-    }
+#endif
 }
 
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center