Revert data propagation order in SearchResultViewModel

This commit is contained in:
Marcus Kida 2024-01-08 11:01:36 +01:00
parent f50d48dc4e
commit 8e0c45f18e
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 4 additions and 4 deletions

View File

@ -147,21 +147,21 @@ extension SearchResultViewModel.State {
// reset data source when the search is refresh
if offset == nil {
await viewModel.dataController.reset()
viewModel.relationships = []
viewModel.accounts = []
await viewModel.dataController.reset()
viewModel.hashtags = []
}
await viewModel.dataController.appendRecords(statuses)
// due to combine relationships must be set first
var existingRelationships = viewModel.relationships
for hashtag in relationships where !existingRelationships.contains(hashtag) {
existingRelationships.append(hashtag)
}
viewModel.relationships = existingRelationships
await viewModel.dataController.appendRecords(statuses)
var existingHashtags = viewModel.hashtags
for hashtag in searchResults.hashtags where !existingHashtags.contains(hashtag) {
existingHashtags.append(hashtag)