Skip to content

Commit

Permalink
Merge pull request #102 from timothylcooke/master-v2
Browse files Browse the repository at this point in the history
Fixes for #101
  • Loading branch information
rafallopatka authored Nov 27, 2019
2 parents f3603b9 + f2c83d5 commit 95ab84f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Src/ToastNotifications/Lifetime/Clear/ClearByTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ public ClearByTag(object tag)
public IEnumerable<INotification> GetNotificationsToRemove(NotificationsList notifications)
{
var notificationsToRemove = notifications
.Where(x => x.Value.Notification.Options.Tag.Equals(_tag))
.Select(x => x.Value.Notification)
.Where(x =>
{
object otherTag = x.Options.Tag;
if (ReferenceEquals(otherTag, null))
{
return ReferenceEquals(_tag, null);
}
else
{
return otherTag.Equals(_tag);
}
})
.ToList();

return notificationsToRemove;
Expand Down

0 comments on commit 95ab84f

Please sign in to comment.