mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 06:00:44 +01:00
upd: emoji autocomplete case-insensitive
Closes bug: transfem-org/Sharkey#129
This commit is contained in:
parent
42a5d473e5
commit
5693e11362
1 changed files with 3 additions and 3 deletions
|
@ -246,20 +246,20 @@ function exec() {
|
||||||
const max = 30;
|
const max = 30;
|
||||||
|
|
||||||
emojiDb.value.some(x => {
|
emojiDb.value.some(x => {
|
||||||
if (x.name.startsWith(props.q ?? '') && !x.aliasOf && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
if (x.name.toLowerCase().startsWith(props.q ? props.q.toLowerCase() : '') && !x.aliasOf && !matched.some(y => y.emoji.toLowerCase() === x.emoji.toLowerCase())) matched.push(x);
|
||||||
return matched.length === max;
|
return matched.length === max;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (matched.length < max) {
|
if (matched.length < max) {
|
||||||
emojiDb.value.some(x => {
|
emojiDb.value.some(x => {
|
||||||
if (x.name.startsWith(props.q ?? '') && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
if (x.name.toLowerCase().startsWith(props.q ? props.q.toLowerCase() : '') && !matched.some(y => y.emoji.toLowerCase() === x.emoji.toLowerCase())) matched.push(x);
|
||||||
return matched.length === max;
|
return matched.length === max;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched.length < max) {
|
if (matched.length < max) {
|
||||||
emojiDb.value.some(x => {
|
emojiDb.value.some(x => {
|
||||||
if (x.name.includes(props.q ?? '') && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
if (x.name.toLowerCase().includes(props.q ? props.q.toLowerCase() : '') && !matched.some(y => y.emoji.toLowerCase() === x.emoji.toLowerCase())) matched.push(x);
|
||||||
return matched.length === max;
|
return matched.length === max;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue