fix: remove same-tag notifications before showing new ones (#24302)

This commit is contained in:
Shelley Vohr 2020-07-02 23:04:32 -07:00 committed by GitHub
parent 2a6d6d6ea7
commit fd0eaf4507
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 5 deletions

View file

@ -111,8 +111,6 @@ void CocoaNotification::Dismiss() {
NotificationDismissed();
this->LogAction("dismissed");
notification_.reset(nil);
}
@ -163,8 +161,9 @@ void CocoaNotification::NotificationDismissed() {
}
void CocoaNotification::LogAction(const char* action) {
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS") && notification_) {
NSString* identifier = [notification_ valueForKey:@"identifier"];
DCHECK(identifier);
LOG(INFO) << "Notification " << action << " (" << [identifier UTF8String]
<< ")";
}