enhance(frontend): 絵文字ピッカー/オートコンプリートで完全一致の絵文字を優先するように (misskey-dev#12928) (MisskeyIO#338)

Co-authored-by: 1step621 <onestep621@gmail.com>
This commit is contained in:
まっちゃとーにゅ 2024-01-07 15:18:22 +09:00 committed by GitHub
parent 91c2efaf04
commit 23f1644bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 4 deletions

View file

@ -225,6 +225,19 @@ watch(q, () => {
}
}
} else {
if (customEmojisMap.has(newQ)) {
matches.add(customEmojisMap.get(newQ)!);
}
if (matches.size >= max) return matches;
for (const emoji of emojis) {
if (emoji.aliases.some(alias => alias === newQ)) {
matches.add(emoji);
if (matches.size >= max) break;
}
}
if (matches.size >= max) return matches;
for (const emoji of emojis) {
if (emoji.name.startsWith(newQ)) {
matches.add(emoji);