forked from shadowfacts/Tusker
Fix not checking if section exists before getting item identifiers
Closes #398
This commit is contained in:
parent
f5f1be9f7d
commit
bf6dfab121
|
@ -263,6 +263,9 @@ class NotificationsCollectionViewController: UIViewController, TimelineLikeColle
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var snapshot = dataSource.snapshot()
|
var snapshot = dataSource.snapshot()
|
||||||
|
guard snapshot.sectionIdentifiers.contains(.notifications) else {
|
||||||
|
return
|
||||||
|
}
|
||||||
let items = snapshot.itemIdentifiers(inSection: .notifications)
|
let items = snapshot.itemIdentifiers(inSection: .notifications)
|
||||||
let toDelete = statusIDs.flatMap { id in
|
let toDelete = statusIDs.flatMap { id in
|
||||||
items.lazy.filter { $0.group?.notifications.first?.status?.id == id }
|
items.lazy.filter { $0.group?.notifications.first?.status?.id == id }
|
||||||
|
|
Loading…
Reference in New Issue