Do not show images twice

This commit fixes a logical error in the blocks rendering function.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3133
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
Daniel D’Aquino
2025-07-21 15:44:44 -07:00
parent e9f4cbe881
commit bdd10cccaa

View File

@@ -266,14 +266,7 @@ func render_blocks(blocks: borrowing NdbBlockGroup, profiles: Profiles, can_hide
invoices.append(inv)
case .url(let url):
guard let url = URL(string: url.as_str()) else { return .loopContinue }
let url_type = classify_url(url)
switch url_type {
case .media:
urls.append(url_type)
case .link(let url):
urls.append(url_type)
return .loopReturn(str + url_str(url))
}
return .loopReturn(str + url_str(url))
case .mention_index:
return .loopContinue
}