Compare commits
No commits in common. "d5c74cccbded703163dc67996daaf984c9b8550d" and "c578846b98dcbeb506b600dc75f528f4a4b18400" have entirely different histories.
d5c74cccbd
...
c578846b98
2 changed files with 1 additions and 16 deletions
|
@ -29,7 +29,6 @@ const Search = {
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
queryCount: 0,
|
|
||||||
loadedInitially: false,
|
loadedInitially: false,
|
||||||
loading: Object.fromEntries(
|
loading: Object.fromEntries(
|
||||||
allSearchTypes.map((searchType) => [searchType, false])
|
allSearchTypes.map((searchType) => [searchType, false])
|
||||||
|
@ -106,8 +105,6 @@ const Search = {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const localQueryCount = ++this.queryCount
|
|
||||||
|
|
||||||
const isNewSearch = this.lastQuery !== query
|
const isNewSearch = this.lastQuery !== query
|
||||||
this.$refs.searchInput.blur()
|
this.$refs.searchInput.blur()
|
||||||
if (isNewSearch) {
|
if (isNewSearch) {
|
||||||
|
@ -165,11 +162,6 @@ const Search = {
|
||||||
local: 'localOnly' in this.filter && this.filter.localOnly
|
local: 'localOnly' in this.filter && this.filter.localOnly
|
||||||
})
|
})
|
||||||
|
|
||||||
if (localQueryCount !== this.queryCount) {
|
|
||||||
// Query count differs, there should be a newer query
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Always append to old results. If new results are empty, this doesn't change anything
|
// Always append to old results. If new results are empty, this doesn't change anything
|
||||||
this.userIds = this.userIds.concat(map(data.accounts, 'id'))
|
this.userIds = this.userIds.concat(map(data.accounts, 'id'))
|
||||||
this.statuses = uniqBy(this.statuses.concat(data.statuses), 'id')
|
this.statuses = uniqBy(this.statuses.concat(data.statuses), 'id')
|
||||||
|
@ -190,11 +182,6 @@ const Search = {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
if (localQueryCount !== this.queryCount) {
|
|
||||||
// Skip cleanups if there's a newer query
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.loadedInitially && this.hasAtLeastOneResult) {
|
if (!this.loadedInitially && this.hasAtLeastOneResult) {
|
||||||
// Show results on the first meaningful response
|
// Show results on the first meaningful response
|
||||||
this.loadedInitially = true
|
this.loadedInitially = true
|
||||||
|
|
|
@ -51,9 +51,7 @@ const SearchBar = {
|
||||||
event.isComposing ||
|
event.isComposing ||
|
||||||
event.metaKey ||
|
event.metaKey ||
|
||||||
event.repeat ||
|
event.repeat ||
|
||||||
event.shiftKey ||
|
event.shiftKey
|
||||||
// not very vue-esque, but as long as it works
|
|
||||||
document.querySelector('.modal-view.modal-background.open')
|
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue