Commit 42d06db3 authored by Erik Reider's avatar Erik Reider

Fixed potential issue where closing latest notification could fail when dismissed

Instead of getting the first/last notification in the AnimatedList, we get the first/last non-destroyed item
parent 8112744d
......@@ -762,17 +762,25 @@ public class AnimatedList : Gtk.Widget, Gtk.Scrollable {
}
public unowned AnimatedListItem ?get_first_item () {
if (children.is_empty ()) {
return null;
for (unowned List<AnimatedListItem> ?link = children.first ();
link != null;
link = link.next) {
if (link.data != null && !link.data.destroying) {
return link.data;
}
}
return children.first ().data;
return null;
}
public unowned AnimatedListItem ?get_last_item () {
if (children.is_empty ()) {
return null;
for (unowned List<AnimatedListItem> ?link = children.last ();
link != null;
link = link.prev) {
if (link.data != null && !link.data.destroying) {
return link.data;
}
}
return children.last ().data;
return null;
}
private bool should_card_animate () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment