Metadata screen

This commit is contained in:
Thomas
2022-12-23 16:12:50 +01:00
parent 549cbb9bce
commit dff450282b
9 changed files with 150 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
import Foundation
class ProfileModel: ObservableObject {
class ProfileModel: ObservableObject, Equatable {
@Published var events: [NostrEvent] = []
@Published var contacts: NostrEvent? = nil
@Published var following: Int = 0
@@ -31,6 +31,14 @@ class ProfileModel: ObservableObject {
self.damus = damus
}
static func == (lhs: ProfileModel, rhs: ProfileModel) -> Bool {
return lhs.pubkey == rhs.pubkey
}
func hash(into hasher: inout Hasher) {
hasher.combine(pubkey)
}
func unsubscribe() {
print("unsubscribing from profile \(pubkey) with sub_id \(sub_id)")
damus.pool.unsubscribe(sub_id: sub_id)