Skip to content
Snippets Groups Projects
Commit 85f7b7c3 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

prevent error if no exact matches

parent f9089d97
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,9 @@ import Menu from './Menu.vue'
.then(async (response) => {
if (self.$refs.autocomplete.searchInput == q & self.suggesting) {
let suggestions = []
suggestions = response.data.a.exact.map(item => ({q: q, match: item[0], time: time, lang: [item[1]], w: true}))
if (response.data.a.exact) {
suggestions = response.data.a.exact.map(item => ({q: q, match: item[0], time: time, lang: [item[1]], w: true}))
}
self.inflection_suggestions = response.data.a.inflect
if (suggestions.length) {
if (suggestions[0].q != suggestions[0].match) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment