Don't pop-in embedded note if we have it cached
Changelog-Changed: Fixed embedded note popping
This commit is contained in:
@@ -13,6 +13,19 @@ struct BuilderEventView: View {
|
|||||||
@State var event: NostrEvent?
|
@State var event: NostrEvent?
|
||||||
@State var subscription_uuid: String = UUID().description
|
@State var subscription_uuid: String = UUID().description
|
||||||
|
|
||||||
|
init(damus: DamusState, event: NostrEvent) {
|
||||||
|
_event = State(initialValue: event)
|
||||||
|
self.damus = damus
|
||||||
|
self.event_id = event.id
|
||||||
|
}
|
||||||
|
|
||||||
|
init(damus: DamusState, event_id: String) {
|
||||||
|
let event = damus.events.lookup(event_id)
|
||||||
|
self.event_id = event_id
|
||||||
|
self.damus = damus
|
||||||
|
_event = State(initialValue: event)
|
||||||
|
}
|
||||||
|
|
||||||
func unsubscribe() {
|
func unsubscribe() {
|
||||||
damus.pool.unsubscribe(sub_id: subscription_uuid)
|
damus.pool.unsubscribe(sub_id: subscription_uuid)
|
||||||
}
|
}
|
||||||
@@ -78,6 +91,9 @@ struct BuilderEventView: View {
|
|||||||
.stroke(Color.gray.opacity(0.2), lineWidth: 1.0)
|
.stroke(Color.gray.opacity(0.2), lineWidth: 1.0)
|
||||||
)
|
)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
guard event == nil else {
|
||||||
|
return
|
||||||
|
}
|
||||||
self.load()
|
self.load()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user