Skip to content

Commit

Permalink
Fix builds on macOS versions pre-11
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
  • Loading branch information
claucambra committed May 25, 2022
1 parent b401bf0 commit 6082c90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/systray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
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
Expand Down

0 comments on commit 6082c90

Please sign in to comment.