2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

Trigger update of view when notification group changes contents.

Fixes IOS-388
This commit is contained in:
shannon 2025-04-07 08:43:14 -04:00
parent fa49cd6630
commit 38e2e6baab

View File

@ -14,7 +14,7 @@ enum NotificationListItem {
case filteredNotificationsInfo(
Mastodon.Entity.NotificationPolicy?,
FilteredNotificationsRowView.ViewModel?)
case notification(MastodonFeedItemIdentifier) // TODO: remove
case notification(MastodonFeedItemIdentifier) // TODO: Remove. Will require rewriting the NotificationRequestsTableViewController.
case groupedNotification(NotificationRowViewModel)
case bottomLoader
@ -82,7 +82,18 @@ extension NotificationListItem: Identifiable, Equatable, Hashable {
static func == (lhs: NotificationListItem, rhs: NotificationListItem)
-> Bool
{
return lhs.id == rhs.id
switch (lhs, rhs) {
case (.filteredNotificationsInfo(let lPolicy, _), .filteredNotificationsInfo(let rPolicy, _)):
return lPolicy == rPolicy
case (.groupedNotification(let lViewModel), .groupedNotification(let rViewModel)):
return lViewModel.identifier == rViewModel.identifier && lViewModel.newestID == rViewModel.newestID
case (.bottomLoader, .bottomLoader):
return true
case (.notification(let lFeedItem), .notification(let rFeedItem)):
return lFeedItem == rFeedItem
default:
return false
}
}
func hash(into hasher: inout Hasher) {