Sorting fix

This commit is contained in:
mrfry 2020-10-13 19:35:27 +02:00
parent 3a7c3f0b54
commit 05eb044c52

View file

@ -300,7 +300,13 @@ function searchQuestion(subj, question, questionData, subjName) {
})
result = result.sort((q1, q2) => {
return q1.match < q2.match
if (q1.match < q2.match) {
return 1
} else if (q1.match > q2.match) {
return -1
} else {
return 0
}
})
return result
@ -406,7 +412,13 @@ function searchData(data, question, subjName, questionData) {
}
result = result.sort((q1, q2) => {
return q1.match < q2.match
if (q1.match < q2.match) {
return 1
} else if (q1.match > q2.match) {
return -1
} else {
return 0
}
})
debugLog(`QDB search result length: ${result.length}`, 'qdb search', 1)