From a2cdc5ae0c69020a7798aa8abcc6d0c10fd8f6b5 Mon Sep 17 00:00:00 2001 From: Ben Toews Date: Wed, 26 Jul 2017 10:59:39 -0600 Subject: [PATCH] don't check if the notification was delivered on high sierra --- SoftU2FTool/UserPresence.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SoftU2FTool/UserPresence.swift b/SoftU2FTool/UserPresence.swift index f16d055..1d6b9c5 100644 --- a/SoftU2FTool/UserPresence.swift +++ b/SoftU2FTool/UserPresence.swift @@ -174,12 +174,17 @@ class UserPresence: NSObject { extension UserPresence: NSUserNotificationCenterDelegate { func userNotificationCenter(_ center: NSUserNotificationCenter, didDeliver notification: NSUserNotification) { - if notification.isPresented { + if #available(OSX 10.13, *) { + // notification.isPresented is always false on the latest 10.13 beta. + installTimer() + } else { + if notification.isPresented { // Alert is showing to user. Watch to see if it's dismissed. installTimer() - } else { + } else { // Alert wasn't shown to user. Fail. complete(false) + } } }