Remove unnecessary wait in note rendering
Previously, the note content rendering logic would wait for the note and its blocks to be available in NostrDB before displaying the parsed version of the note to the user. However, it is now possible to parse those on demand, and there are code paths to ensure that it will do so if those parsed blocks are not readily available from NostrDB. Therefore, the wait is not necessary, and removing it fixes the delay we have been experiencing. The issue was likely introduced after the last public release, so no changelog item is needed Changelog-None Closes: https://github.com/damus-io/damus/issues/3296 Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -83,12 +83,6 @@ func render_immediately_available_note_content(ndb: Ndb, ev: NostrEvent, profile
|
||||
|
||||
actor ContentRenderer {
|
||||
func render_note_content(ndb: Ndb, ev: NostrEvent, profiles: Profiles, keypair: Keypair) async -> NoteArtifacts {
|
||||
if ev.known_kind == .dm {
|
||||
// Use the enhanced render_immediately_available_note_content which now handles DMs properly
|
||||
// by decrypting and parsing the content with ndb_parse_content
|
||||
return render_immediately_available_note_content(ndb: ndb, ev: ev, profiles: profiles, keypair: keypair)
|
||||
}
|
||||
let result = try? await ndb.waitFor(noteId: ev.id, timeout: 3)
|
||||
return render_immediately_available_note_content(ndb: ndb, ev: ev, profiles: profiles, keypair: keypair)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user