add question fix

This commit is contained in:
mrfry 2022-03-28 21:41:57 +02:00
parent 1a76ca2536
commit 347952c6da
2 changed files with 51 additions and 3 deletions

View file

@ -460,10 +460,10 @@ function addQuestion(
logger.DebugLog('Adding new question with subjName: ' + subj, 'qdb add', 1)
logger.DebugLog(question, 'qdb add', 3)
const i = data.findIndex((x) => {
return !subj
const i = data.findIndex((subject) => {
return subj
.toLowerCase()
.includes(getSubjNameWithoutYear(x.Name).toLowerCase())
.includes(getSubjNameWithoutYear(subject.Name).toLowerCase())
})
if (i !== -1) {