mirror of
https://github.com/mmjee/Piped-Material.git
synced 2024-12-06 19:26:36 +01:00
Potential fix to the search menu
This commit is contained in:
@@ -37,11 +37,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
searchText (val) {
|
searchText: 'refreshSuggestions',
|
||||||
if (val && val !== this.select) {
|
|
||||||
this.refreshSuggestions()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async select (val) {
|
async select (val) {
|
||||||
if (val === '') {
|
if (val === '') {
|
||||||
@@ -63,16 +59,23 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
searchSuggestions () {
|
searchSuggestions () {
|
||||||
|
/*
|
||||||
if (this.searchText.length === 0) {
|
if (this.searchText.length === 0) {
|
||||||
return this.actualSuggestions
|
return this.actualSuggestions
|
||||||
} else {
|
} else {
|
||||||
return [this.searchText].concat(this.actualSuggestions)
|
return [this.searchText].concat(this.actualSuggestions)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
return [this.searchText].concat(this.actualSuggestions)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
refreshSuggestions: _debounce(async function refreshSuggestions () {
|
refreshSuggestions: _debounce(async function refreshSuggestions () {
|
||||||
|
if (this.searchText.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.requestInProgress = true
|
this.requestInProgress = true
|
||||||
const suggestions = await this.$store.dispatch('auth/makeRequest', {
|
const suggestions = await this.$store.dispatch('auth/makeRequest', {
|
||||||
path: '/suggestions',
|
path: '/suggestions',
|
||||||
|
|||||||
Reference in New Issue
Block a user