From ceb60d61b05e32fa340269122378ea93efb20517 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:47:30 +0900 Subject: [PATCH] refactor --- packages/frontend/src/pages/emoji-edit-dialog.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/pages/emoji-edit-dialog.vue b/packages/frontend/src/pages/emoji-edit-dialog.vue index 2caba0367..db3f43687 100644 --- a/packages/frontend/src/pages/emoji-edit-dialog.vue +++ b/packages/frontend/src/pages/emoji-edit-dialog.vue @@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only :initialHeight="500" :canResize="true" @close="windowEl.close()" - @closed="$emit('closed')" + @closed="emit('closed')" > @@ -98,6 +98,11 @@ const props = defineProps<{ emoji?: Misskey.entities.EmojiDetailed, }>(); +const emit = defineEmits<{ + (ev: 'done', v: { deleted?: boolean; updated?: Misskey.entities.AdminEmojiUpdateRequest; created?: Misskey.entities.AdminEmojiUpdateRequest }): void, + (ev: 'closed'): void +}>(); + const windowEl = ref | null>(null); const name = ref(props.emoji ? props.emoji.name : ''); const category = ref(props.emoji?.category ? props.emoji.category : ''); @@ -115,11 +120,6 @@ watch(roleIdsThatCanBeUsedThisEmojiAsReaction, async () => { const imgUrl = computed(() => file.value ? file.value.url : props.emoji ? `/emoji/${props.emoji.name}.webp` : null); -const emit = defineEmits<{ - (ev: 'done', v: { deleted?: boolean; updated?: Misskey.entities.AdminEmojiUpdateRequest; created?: Misskey.entities.AdminEmojiUpdateRequest }): void, - (ev: 'closed'): void -}>(); - async function changeImage(ev: Event) { file.value = await selectFile(ev.currentTarget ?? ev.target, null); const candidate = file.value.name.replace(/\.(.+)$/, '');