commit 3b81592ca28a45005b6273221e7b864489d88d2c
parent 696d341f793c3240cbaa226a3ed50509dafd3e84
Author: William Casarin <jb55@jb55.com>
Date: Sun, 1 Jan 2023 10:01:48 -0800
Load profiles in DMs and notifications
Changelog-Fixed: Load profiles in DMs and notifications
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift
@@ -44,6 +44,7 @@ class HomeModel: ObservableObject {
let notifications_subid = UUID().description
let dms_subid = UUID().description
let init_subid = UUID().description
+ let profiles_subid = UUID().description
@Published var new_events: NewEventsBits = NewEventsBits()
@Published var notifications: [NostrEvent] = []
@@ -234,7 +235,15 @@ class HomeModel: ObservableObject {
//self.events.insert(NostrEvent(content: "NOTICE from \(relay_id): \(msg)", pubkey: "system"), at: 0)
print(msg)
- case .eose:
+ case .eose(let sub_id):
+
+ if sub_id == dms_subid {
+ let dms = dms.dms.flatMap { $0.1.events }
+ load_profiles(profiles_subid: profiles_subid, relay_id: relay_id, events: dms, damus_state: damus_state)
+ } else if sub_id == notifications_subid {
+ load_profiles(profiles_subid: profiles_subid, relay_id: relay_id, events: notifications, damus_state: damus_state)
+ }
+
self.loading = false
break
}