summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCenTdemeern1 <timo.herngreen@gmail.com>2024-10-10 21:48:53 +0200
committerCenTdemeern1 <timo.herngreen@gmail.com>2024-10-10 21:48:53 +0200
commit5cebb4da544ff3339ec06a0c77c564192c5fc82e (patch)
tree648b552005453aea930bfa351d2bb24eb213ede1
parentmerge: Show instance sponsors if OC is set as donation url (!642) (diff)
downloadsharkey-5cebb4da544ff3339ec06a0c77c564192c5fc82e.tar.gz
sharkey-5cebb4da544ff3339ec06a0c77c564192c5fc82e.tar.bz2
sharkey-5cebb4da544ff3339ec06a0c77c564192c5fc82e.zip
fix: Finding emoji that include capital letters
Custom emoji names and aliases that include capital letters can now be found in the emoji picker. I kind of hate copy-pasting `.toLowerCase()` like this but apparently I'm not allowed to refactor Misskey code.
-rw-r--r--packages/frontend/src/components/MkEmojiPicker.vue14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue
index 297d5f899e..43df9df018 100644
--- a/packages/frontend/src/components/MkEmojiPicker.vue
+++ b/packages/frontend/src/components/MkEmojiPicker.vue
@@ -233,7 +233,7 @@ watch(q, () => {
// 名前にキーワードが含まれている
for (const emoji of emojis) {
- if (keywords.every(keyword => emoji.name.includes(keyword))) {
+ if (keywords.every(keyword => emoji.name.toLowerCase().includes(keyword))) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -242,7 +242,7 @@ watch(q, () => {
// 名前またはエイリアスにキーワードが含まれている
for (const emoji of emojis) {
- if (keywords.every(keyword => emoji.name.includes(keyword) || emoji.aliases.some(alias => alias.includes(keyword)))) {
+ if (keywords.every(keyword => emoji.name.toLowerCase().includes(keyword) || emoji.aliases.some(alias => alias.toLowerCase().includes(keyword)))) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -254,7 +254,7 @@ watch(q, () => {
if (matches.size >= max) return matches;
for (const emoji of emojis) {
- if (emoji.aliases.some(alias => alias === newQ)) {
+ if (emoji.aliases.some(alias => alias.toLowerCase() === newQ)) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -262,7 +262,7 @@ watch(q, () => {
if (matches.size >= max) return matches;
for (const emoji of emojis) {
- if (emoji.name.startsWith(newQ)) {
+ if (emoji.name.toLowerCase().startsWith(newQ)) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -270,7 +270,7 @@ watch(q, () => {
if (matches.size >= max) return matches;
for (const emoji of emojis) {
- if (emoji.aliases.some(alias => alias.startsWith(newQ))) {
+ if (emoji.aliases.some(alias => alias.toLowerCase().startsWith(newQ))) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -278,7 +278,7 @@ watch(q, () => {
if (matches.size >= max) return matches;
for (const emoji of emojis) {
- if (emoji.name.includes(newQ)) {
+ if (emoji.name.toLowerCase().includes(newQ)) {
matches.add(emoji);
if (matches.size >= max) break;
}
@@ -286,7 +286,7 @@ watch(q, () => {
if (matches.size >= max) return matches;
for (const emoji of emojis) {
- if (emoji.aliases.some(alias => alias.includes(newQ))) {
+ if (emoji.aliases.some(alias => alias.toLowerCase().includes(newQ))) {
matches.add(emoji);
if (matches.size >= max) break;
}