mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 18:25:45 +01:00
Fix lint issues in emoji picker components (#8620)
* fix(client): fix lint issues in emoji picker components * fix(client): switch argument naming for emoji picker section event
This commit is contained in:
parent
a975a0971c
commit
7bd45e5729
3 changed files with 9 additions and 9 deletions
|
@ -25,8 +25,8 @@ withDefaults(defineProps<{
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'chosen', v: any): void;
|
(ev: 'chosen', v: any): void;
|
||||||
(e: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
function chosen(emoji: any) {
|
function chosen(emoji: any) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'chosen', v: string, ev: MouseEvent): void;
|
(ev: 'chosen', v: string, event: MouseEvent): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const shown = ref(!!props.initialShown);
|
const shown = ref(!!props.initialShown);
|
||||||
|
|
|
@ -97,7 +97,7 @@ const props = withDefaults(defineProps<{
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'chosen', v: string): void;
|
(ev: 'chosen', v: string): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const search = ref<HTMLInputElement>();
|
const search = ref<HTMLInputElement>();
|
||||||
|
@ -138,7 +138,7 @@ watch(q, () => {
|
||||||
const emojis = customEmojis;
|
const emojis = customEmojis;
|
||||||
const matches = new Set<Misskey.entities.CustomEmoji>();
|
const matches = new Set<Misskey.entities.CustomEmoji>();
|
||||||
|
|
||||||
const exactMatch = emojis.find(e => e.name === newQ);
|
const exactMatch = emojis.find(emoji => emoji.name === newQ);
|
||||||
if (exactMatch) matches.add(exactMatch);
|
if (exactMatch) matches.add(exactMatch);
|
||||||
|
|
||||||
if (newQ.includes(' ')) { // AND検索
|
if (newQ.includes(' ')) { // AND検索
|
||||||
|
@ -201,7 +201,7 @@ watch(q, () => {
|
||||||
const emojis = emojilist;
|
const emojis = emojilist;
|
||||||
const matches = new Set<UnicodeEmojiDef>();
|
const matches = new Set<UnicodeEmojiDef>();
|
||||||
|
|
||||||
const exactMatch = emojis.find(e => e.name === newQ);
|
const exactMatch = emojis.find(emoji => emoji.name === newQ);
|
||||||
if (exactMatch) matches.add(exactMatch);
|
if (exactMatch) matches.add(exactMatch);
|
||||||
|
|
||||||
if (newQ.includes(' ')) { // AND検索
|
if (newQ.includes(' ')) { // AND検索
|
||||||
|
@ -295,7 +295,7 @@ function chosen(emoji: any, ev?: MouseEvent) {
|
||||||
// 最近使った絵文字更新
|
// 最近使った絵文字更新
|
||||||
if (!pinned.value.includes(key)) {
|
if (!pinned.value.includes(key)) {
|
||||||
let recents = defaultStore.state.recentlyUsedEmojis;
|
let recents = defaultStore.state.recentlyUsedEmojis;
|
||||||
recents = recents.filter((e: any) => e !== key);
|
recents = recents.filter((emoji: any) => emoji !== key);
|
||||||
recents.unshift(key);
|
recents.unshift(key);
|
||||||
defaultStore.set('recentlyUsedEmojis', recents.splice(0, 32));
|
defaultStore.set('recentlyUsedEmojis', recents.splice(0, 32));
|
||||||
}
|
}
|
||||||
|
@ -313,12 +313,12 @@ function done(query?: any): boolean | void {
|
||||||
if (query == null || typeof query !== 'string') return;
|
if (query == null || typeof query !== 'string') return;
|
||||||
|
|
||||||
const q2 = query.replace(/:/g, '');
|
const q2 = query.replace(/:/g, '');
|
||||||
const exactMatchCustom = customEmojis.find(e => e.name === q2);
|
const exactMatchCustom = customEmojis.find(emoji => emoji.name === q2);
|
||||||
if (exactMatchCustom) {
|
if (exactMatchCustom) {
|
||||||
chosen(exactMatchCustom);
|
chosen(exactMatchCustom);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const exactMatchUnicode = emojilist.find(e => e.char === q2 || e.name === q2);
|
const exactMatchUnicode = emojilist.find(emoji => emoji.char === q2 || emoji.name === q2);
|
||||||
if (exactMatchUnicode) {
|
if (exactMatchUnicode) {
|
||||||
chosen(exactMatchUnicode);
|
chosen(exactMatchUnicode);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue