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 => { authors.forEach(author => {
const lowerAuthor = author.toLowerCase(); const lowerAuthor = author.toLowerCase();
let distance = this.levenshteinDistance(lowerMention, lowerAuthor); let distance = this.levenshteinDistance(lowerMention, lowerAuthor);
if(!this.isSubsequence(lowerMention,lowerAuthor)) { if(!this.isSubsequence(lowerMention,lowerAuthor)) {
distance += 10 distance += 10
} }
console.info([ mention, author, distance ]);
if (distance < minDistance) { if (distance < minDistance) {
minDistance = distance; minDistance = distance;
closestAuthor = author; closestAuthor = author;
} }
console.info({ mention, closestAuthor, distance });
}); });
return { mention, closestAuthor, distance: minDistance }; return { mention, closestAuthor, distance: minDistance };