Enhance(frontend): 絵文字ピッカー/オートコンプリートで完全一致の絵文字を優先するように (#12928)
* 絵文字ピッカー/オートコンプリートで完全一致の絵文字を優先するように * update CHANGELOG.md * improve performance
This commit is contained in:
parent
4bd9f664d7
commit
c1c363bf08
3 changed files with 27 additions and 4 deletions
|
@ -221,6 +221,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue