Fix status URLs with fragments not being resolved

This commit is contained in:
Shadowfacts 2023-01-26 21:15:02 -05:00
parent d638ea054b
commit f1facea929
1 changed files with 3 additions and 3 deletions

View File

@ -189,11 +189,11 @@ class ConversationViewController: UIViewController {
indicator.startAnimating()
state = .loading(indicator)
let url = WebURL(url)!
let request = Client.search(query: url.serialized(), types: [.statuses], resolve: true)
let url = WebURL(url)!.serialized(excludingFragment: true)
let request = Client.search(query: url, types: [.statuses], resolve: true)
do {
let (results, _) = try await mastodonController.run(request)
guard let status = results.statuses.first(where: { $0.url == url }) else {
guard let status = results.statuses.first(where: { $0.url?.serialized() == url }) else {
throw UnableToResolveError()
}
_ = mastodonController.persistentContainer.addOrUpdateOnViewContext(status: status)