From: David ‘Bombe’ Roden Date: Wed, 17 Nov 2010 20:45:46 +0000 (+0100) Subject: Let the list notification dismiss itself automatically when it’s empty. X-Git-Tag: 0.3-RC1~11 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=92b5ee58620b50020b3fe9a1a942ded9a0d59c9e;p=Sone.git Let the list notification dismiss itself automatically when it’s empty. --- diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index 64c2ecb..423bea4 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -84,6 +84,9 @@ public class ListNotification extends TemplateNotification { */ public void remove(T element) { elements.remove(element); + if (elements.isEmpty()) { + dismiss(); + } touch(); } diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index db1880b..747b192 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -419,9 +419,6 @@ public class WebInterface implements CoreListener { @Override public void markSoneKnown(Sone sone) { newSoneNotification.remove(sone); - if (newSoneNotification.isEmpty()) { - newSoneNotification.dismiss(); - } } /** @@ -430,9 +427,6 @@ public class WebInterface implements CoreListener { @Override public void markPostKnown(Post post) { newPostNotification.remove(post); - if (newPostNotification.isEmpty()) { - newPostNotification.dismiss(); - } } /** @@ -441,9 +435,6 @@ public class WebInterface implements CoreListener { @Override public void markReplyKnown(Reply reply) { newReplyNotification.remove(reply); - if (newReplyNotification.isEmpty()) { - newReplyNotification.dismiss(); - } } /**