Revert data propagation order in SearchResultViewModel
This commit is contained in:
parent
f50d48dc4e
commit
8e0c45f18e
|
@ -147,21 +147,21 @@ extension SearchResultViewModel.State {
|
||||||
|
|
||||||
// reset data source when the search is refresh
|
// reset data source when the search is refresh
|
||||||
if offset == nil {
|
if offset == nil {
|
||||||
await viewModel.dataController.reset()
|
|
||||||
viewModel.relationships = []
|
viewModel.relationships = []
|
||||||
viewModel.accounts = []
|
viewModel.accounts = []
|
||||||
|
await viewModel.dataController.reset()
|
||||||
viewModel.hashtags = []
|
viewModel.hashtags = []
|
||||||
}
|
}
|
||||||
|
|
||||||
await viewModel.dataController.appendRecords(statuses)
|
|
||||||
|
|
||||||
|
|
||||||
|
// due to combine relationships must be set first
|
||||||
var existingRelationships = viewModel.relationships
|
var existingRelationships = viewModel.relationships
|
||||||
for hashtag in relationships where !existingRelationships.contains(hashtag) {
|
for hashtag in relationships where !existingRelationships.contains(hashtag) {
|
||||||
existingRelationships.append(hashtag)
|
existingRelationships.append(hashtag)
|
||||||
}
|
}
|
||||||
viewModel.relationships = existingRelationships
|
viewModel.relationships = existingRelationships
|
||||||
|
|
||||||
|
await viewModel.dataController.appendRecords(statuses)
|
||||||
|
|
||||||
var existingHashtags = viewModel.hashtags
|
var existingHashtags = viewModel.hashtags
|
||||||
for hashtag in searchResults.hashtags where !existingHashtags.contains(hashtag) {
|
for hashtag in searchResults.hashtags where !existingHashtags.contains(hashtag) {
|
||||||
existingHashtags.append(hashtag)
|
existingHashtags.append(hashtag)
|
||||||
|
|
Loading…
Reference in New Issue