Scrolled to bottom fix.

This commit is contained in:
retoor 2025-05-27 12:21:40 +02:00
parent bf723db2cc
commit 40a292d05e

View File

@ -81,7 +81,7 @@ class ChatInputComponent extends HTMLElement {
distance += 10
}
console.info([ mention, author, distance ]);
console.warn([ mention, author, distance ]);
if (distance < minDistance) {
minDistance = distance;
closestAuthor = author;
@ -129,11 +129,9 @@ levenshteinDistance(a, b) {
const mentions = this.extractMentions(text);
const matches = this.matchMentionsToAuthors(mentions, authors);
console.info(matches)
let updatedText = text;
matches.forEach(({ mention, closestAuthor }) => {
const mentionRegex = new RegExp(`@${mention}`, 'g');
console.info(closestAuthor)
updatedText = updatedText.replace(mentionRegex, `@${closestAuthor}`);
});