Add scroll queue detection in notification view

This will stop injecting events into the timeline if you're scrolling
This commit is contained in:
William Casarin
2023-02-26 14:14:25 -08:00
parent 75fd8de456
commit 4b5c217213
4 changed files with 33 additions and 14 deletions

View File

@@ -45,7 +45,8 @@ enum NotificationItem {
}
}
class NotificationsModel: ObservableObject {
class NotificationsModel: ObservableObject, ScrollQueue {
var incoming_zaps: [Zap]
var incoming_events: [NostrEvent]
var should_queue: Bool
@@ -73,6 +74,10 @@ class NotificationsModel: ObservableObject {
self.notifications = []
}
func set_should_queue(_ val: Bool) {
self.should_queue = val
}
func uniq_pubkeys() -> [String] {
var pks = Set<String>()