mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-02 23:47:30 +01:00
Don't add duplicate notifications
This commit is contained in:
parent
07bfa47d49
commit
9cf7066663
@ -90,7 +90,8 @@ class NotificationsViewModel: ObservableObject {
|
||||
}
|
||||
|
||||
func handleEvent(event: any StreamEvent) {
|
||||
if let event = event as? StreamEventNotification {
|
||||
if let event = event as? StreamEventNotification,
|
||||
!notifications.contains(where: { $0.id == event.notification.id }) {
|
||||
notifications.insert(event.notification, at: 0)
|
||||
state = .display(notifications: notifications, nextPageState: .hasNextPage)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user