Add Error handling for search suggestions
This commit is contained in:
parent
c8da6fec3d
commit
42046a00de
|
@ -127,6 +127,12 @@ export default Vue.extend({
|
||||||
ytSuggest(query).then((results) => {
|
ytSuggest(query).then((results) => {
|
||||||
this.searchSuggestionsDataList = results
|
this.searchSuggestionsDataList = results
|
||||||
this.searchValue = query
|
this.searchValue = query
|
||||||
|
}).error((err) => {
|
||||||
|
console.log(err)
|
||||||
|
if (this.backendFallback) {
|
||||||
|
console.log('Error gettings search suggestions. Falling back to Invidious API')
|
||||||
|
this.getSearchSuggestionsInvidious(query)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -148,6 +154,12 @@ export default Vue.extend({
|
||||||
this.$store.dispatch('invidiousAPICall', searchPayload).then((results) => {
|
this.$store.dispatch('invidiousAPICall', searchPayload).then((results) => {
|
||||||
this.searchSuggestionsDataList = results.suggestions
|
this.searchSuggestionsDataList = results.suggestions
|
||||||
this.searchValue = query
|
this.searchValue = query
|
||||||
|
}).error((err) => {
|
||||||
|
console.log(err)
|
||||||
|
if (this.backendFallback) {
|
||||||
|
console.log('Error gettings search suggestions. Falling back to Local API')
|
||||||
|
this.getSearchSuggestionsLocal(query)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue