diff --git a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultSection.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultSection.swift index 042b6f489..42b1a1585 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultSection.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultSection.swift @@ -54,6 +54,7 @@ extension SearchResultSection { relationship: relationship, delegate: configuration.userTableViewCellDelegate ) + return cell case .status(let status): let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: StatusTableViewCell.self), for: indexPath) as! StatusTableViewCell configure( diff --git a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift index 97624057e..832acb4e3 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift @@ -123,10 +123,8 @@ extension SearchResultViewModel.State { // discard result when state is not Loading guard stateMachine.currentState is Loading else { return } -//<<<<<<< remove_status -// let userIDs = response.value.accounts.map { $0.id } -// let statusIDs = response.value.statuses.map { MastodonStatus.fromEntity($0) } -//======= + let statusIDs = searchResults.statuses.map { MastodonStatus.fromEntity($0) } + let accounts = searchResults.accounts let relationships = try await viewModel.context.apiService.relationship( @@ -134,9 +132,6 @@ extension SearchResultViewModel.State { authenticationBox: viewModel.authContext.mastodonAuthenticationBox ).value - let statusIDs = searchResults.statuses.map { $0.id } -//>>>>>>> develop - let isNoMore = accounts.isEmpty && statusIDs.isEmpty if viewModel.searchScope == .all || isNoMore { @@ -150,11 +145,9 @@ extension SearchResultViewModel.State { await viewModel.statusFetchedResultsController.reset() viewModel.relationships = [] viewModel.accounts = [] - //viewModel.statusFetchedResultsController.statusIDs = [] viewModel.hashtags = [] } - viewModel.userFetchedResultsController.append(userIDs: userIDs) await viewModel.statusFetchedResultsController.appendRecords(statusIDs) @@ -163,8 +156,6 @@ extension SearchResultViewModel.State { existingRelationships.append(hashtag) } viewModel.relationships = existingRelationships - - viewModel.statusFetchedResultsController.append(statusIDs: statusIDs) var existingHashtags = viewModel.hashtags for hashtag in searchResults.hashtags where !existingHashtags.contains(hashtag) {