Thread Caching

Changelog-Added: Threads now load instantly and are cached
This commit is contained in:
William Casarin
2023-03-04 14:33:01 -05:00
parent b58baca227
commit d0a6c2e2e4
20 changed files with 433 additions and 539 deletions
+3 -3
View File
@@ -35,14 +35,14 @@ struct ChatView: View {
}
if let rep = thread.replies.lookup(event.id) {
return rep == prev.id
return rep.contains(prev.id)
}
return false
}
var is_active: Bool {
return thread.initial_event.id == event.id
return thread.event.id == event.id
}
func prev_reply_is_same() -> String? {
@@ -161,7 +161,7 @@ func prev_reply_is_same(event: NostrEvent, prev_ev: NostrEvent?, replies: ReplyM
if let prev_reply_id = replies.lookup(prev.id) {
if let cur_reply_id = replies.lookup(event.id) {
if prev_reply_id != cur_reply_id {
return cur_reply_id
return cur_reply_id.first
}
}
}