This commit is contained in:
Thomas Ricouard 2023-01-19 07:45:42 +01:00
parent f743adb1df
commit e81ea4ee81
2 changed files with 8 additions and 5 deletions

View file

@ -103,11 +103,14 @@ class NotificationsViewModel: ObservableObject {
}
func handleEvent(event: any StreamEvent) {
if selectedType == nil,
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)
if let selectedType, event.notification.type == selectedType.rawValue {
notifications.insert(event.notification, at: 0)
} else {
notifications.insert(event.notification, at: 0)
}
state = .display(notifications: notifications, nextPageState: .hasNextPage)
}
}

View file

@ -33,7 +33,7 @@ public struct StatusMediaPreviewView: View {
if attachments.count == 1 {
return 300
}
return attachments.count > 2 ? 100 : 200
return attachments.count > 2 ? 150 : 200
}
private func size(for media: MediaAttachment) -> CGSize? {
@ -181,7 +181,7 @@ public struct StatusMediaPreviewView: View {
placeholder: {
RoundedRectangle(cornerRadius: 4)
.fill(Color.gray)
.frame(maxHeight: isNotifications ? imageMaxHeight : nil)
.frame(height: imageMaxHeight)
.shimmering()
}
)