Scrolled to bottom fix.

This commit is contained in:
retoor 2025-05-27 12:16:47 +02:00
parent 46052172b2
commit bf723db2cc

View File

@ -75,15 +75,19 @@ class ChatInputComponent extends HTMLElement {
authors.forEach(author => {
const lowerAuthor = author.toLowerCase();
let distance = this.levenshteinDistance(lowerMention, lowerAuthor);
if(!this.isSubsequence(lowerMention,lowerAuthor)) {
distance += 10
}
console.info([ mention, author, distance ]);
if (distance < minDistance) {
minDistance = distance;
closestAuthor = author;
}
console.info({ mention, closestAuthor, distance });
});
return { mention, closestAuthor, distance: minDistance };