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

@ -37,8 +37,11 @@ void NotificationPresenter::CloseNotificationWithId(
[&notification_id](const Notification* n) {
return n->notification_id() == notification_id;
});
if (it != notifications_.end())
(*it)->Dismiss();
if (it != notifications_.end()) {
Notification* notification = (*it);
notification->Dismiss();
notifications_.erase(notification);
}
}
} // namespace electron