Fix linting in MkEmojiPicker and custom-emojis in frontend

This commit is contained in:
zima 2024-12-21 18:25:35 -07:00
parent 695e7fd68e
commit 84f86f526d
2 changed files with 5 additions and 8 deletions

View file

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<!-- このコンポーネントの要素のclassは親から利用されるのでむやみに弄らないこと -->
<!-- フォルダの中にはカスタム絵文字だけUnicode絵文字もこっち -->
<section v-if="!hasChildSection" :data-shown="shown" v-panel style="border-radius: var(--radius-sm); border-bottom: 0.5px solid var(--divider);">
<section v-if="!hasChildSection" v-panel :data-shown="shown" style="border-radius: var(--radius-sm); border-bottom: 0.5px solid var(--divider);">
<header class="_acrylic" :data-shown="shown" @click="shown = !shown">
<i class="toggle ti-fw" :class="shown ? 'ph-bold ph-caret-down' : 'ph-bold ph-caret-right'"></i> <slot></slot>
<span class="emoji-count"><i class="ph-smiley ph-bold ph-lg"></i> {{ emojis.length }}</span>
@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<header class="_acrylic" :data-shown="shown" @click="shown = !shown">
<i class="toggle ti-fw" :class="shown ? 'ph-bold ph-caret-down' : 'ph-bold ph-caret-right'"></i> <slot></slot>
<span class="emoji-count"><i class="ph-folder ph-bold"></i> {{ customEmojiTree?.length }}</span>
<span class="emoji-count" v-if="emojis.length > 0"><i class="ph-smiley ph-bold"></i> {{ emojis.length }}</span>
<span v-if="emojis.length > 0" class="emoji-count"><i class="ph-smiley ph-bold"></i> {{ emojis.length }}</span>
</header>
<div v-if="shown" style="padding-left: 9px;">
<MkEmojiPickerSection

View file

@ -22,14 +22,11 @@ export const customEmojiCategories = computed<[ ...string[], null ]>(() => {
export function compareBySortKey(a: Misskey.entities.EmojiSimple, b: Misskey.entities.EmojiSimple): number {
if (a.sortKey === b.sortKey) {
if (a.name === b.name)
return 0;
if (a.name === b.name) return 0;
return (a.name > b.name) ? 1 : -1;
}
if (a.sortKey === null)
return 1;
if (b.sortKey === null)
return -1;
if (a.sortKey === null) return 1;
if (b.sortKey === null) return -1;
return (a.sortKey > b.sortKey) ? 1 : -1;
}