If refactoring is so good, why isn't there refactoring 2?

This commit is contained in:
itepechi 2023-11-06 08:27:14 +09:00
parent 3afad74579
commit bdc1e9d9c6
1 changed files with 9 additions and 11 deletions

View File

@ -168,7 +168,14 @@ const Search = {
skipMediaSearch = true
}
}
this.loadedInitially = true
if (
!loadedInitially &&
Object.values(data).some((result) => result.length > 0)
) {
// Show results on the first meaningful response
this.loadedInitially = true
}
if (searchType === 'statuses') {
// Offset from whatever we already have
@ -179,19 +186,10 @@ const Search = {
this.mediaOffset = this.media.length
this.lastMediaFetchCount = this.media.length - oldMediaLength
}
if (searchTypes.length > 1) {
for (const value of Object.values(data)) {
if (value.length) {
// Show results on the first meaningful response
this.loading = false
break
}
}
}
}
this.lastQuery = query
this.loadedInitially = true
this.loading = false
},
resultCount (tabName) {