mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 08:52:20 +00:00
Only leave one autotype notification in the stacke to prevent polution.
This commit is contained in:
@@ -39,6 +39,19 @@ NSString *const MPUserNotificationTypeRunAutotypeDoctor = @"MPUserNotificationTy
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didDeliverNotification:(NSUserNotification *)notification {
|
||||
/* we only clean autotype feedback. the rest piles up */
|
||||
if(![notification.identifier isEqualToString:MPUserNotificationTypeAutotypeFeedback]) {
|
||||
return;
|
||||
}
|
||||
for(NSUserNotification *deliveredNotification in center.deliveredNotifications) {
|
||||
if(deliveredNotification == notification) {
|
||||
continue;
|
||||
}
|
||||
[center removeDeliveredNotification:deliveredNotification];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification {
|
||||
NSDictionary *userInfo = notification.userInfo;
|
||||
NSString *notificationType = userInfo[MPUserNotificationTypeKey];
|
||||
|
||||
Reference in New Issue
Block a user