From 174fb434cc5130e50bc8a4e86267f89cfc0ddc44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Thu, 2 Jul 2026 09:24:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20frontend-embed=E3=81=A7=E8=A6=8B?= =?UTF-8?q?=E3=81=A4=E3=81=91=E3=81=9F=E5=9E=8B=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#17650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend-embed/src/components/EmNote.vue | 2 +- packages/frontend-embed/src/components/EmPagination.vue | 2 +- packages/frontend-embed/src/components/EmReactionsViewer.vue | 4 ++-- packages/frontend-embed/src/components/I18n.vue | 5 ++++- packages/frontend-embed/src/custom-emojis.ts | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/frontend-embed/src/components/EmNote.vue b/packages/frontend-embed/src/components/EmNote.vue index f5b064c293..c8bea02135 100644 --- a/packages/frontend-embed/src/components/EmNote.vue +++ b/packages/frontend-embed/src/components/EmNote.vue @@ -149,7 +149,7 @@ const isRenote = Misskey.note.isPureRenote(note.value); const rootEl = shallowRef(); const renoteTime = shallowRef(); -const appearNote = computed(() => getAppearNote(note.value)); +const appearNote = computed(() => getAppearNote(note.value) ?? note.value); const showContent = ref(false); const parsed = computed(() => appearNote.value.text ? mfm.parse(appearNote.value.text) : null); const isLong = shouldCollapsed(appearNote.value, []); diff --git a/packages/frontend-embed/src/components/EmPagination.vue b/packages/frontend-embed/src/components/EmPagination.vue index bd49d127a9..197584908c 100644 --- a/packages/frontend-embed/src/components/EmPagination.vue +++ b/packages/frontend-embed/src/components/EmPagination.vue @@ -244,7 +244,7 @@ const fetchMore = async (): Promise => { if (i === 10) item._shouldInsertAd_ = true; } - const reverseConcat = _res => { + const reverseConcat = (_res: MisskeyEntity[]) => { const oldHeight = scrollableElement.value ? scrollableElement.value.scrollHeight : getBodyScrollHeight(); const oldScroll = scrollableElement.value ? scrollableElement.value.scrollTop : window.scrollY; diff --git a/packages/frontend-embed/src/components/EmReactionsViewer.vue b/packages/frontend-embed/src/components/EmReactionsViewer.vue index f5aa6bdc3f..91a5cd0fdd 100644 --- a/packages/frontend-embed/src/components/EmReactionsViewer.vue +++ b/packages/frontend-embed/src/components/EmReactionsViewer.vue @@ -27,8 +27,8 @@ const initialReactions = new Set(Object.keys(props.note.reactions)); const reactions = ref<[string, number][]>([]); const hasMoreReactions = ref(false); -if (props.note.myReaction && !Object.keys(reactions.value).includes(props.note.myReaction)) { - reactions.value[props.note.myReaction] = props.note.reactions[props.note.myReaction]; +if (props.note.myReaction != null && !(props.note.myReaction in props.note.reactions)) { + reactions.value.push([props.note.myReaction, props.note.reactions[props.note.myReaction]]); } function onMockToggleReaction(emoji: string, count: number) { diff --git a/packages/frontend-embed/src/components/I18n.vue b/packages/frontend-embed/src/components/I18n.vue index 9866e50958..9bd699d5ac 100644 --- a/packages/frontend-embed/src/components/I18n.vue +++ b/packages/frontend-embed/src/components/I18n.vue @@ -46,6 +46,9 @@ const parsed = computed(() => { }); const render = () => { - return h(props.tag, parsed.value.map(x => typeof x === 'string' ? (props.textTag ? h(props.textTag, x) : x) : slots[x.arg]())); + // slotsの型はTの条件型で決まり文字列インデックスアクセスができないため、 + // frontend側の同名コンポーネント (packages/frontend/src/components/global/I18n.vue) と同じくanyでキャストする + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return h(props.tag, parsed.value.map(x => typeof x === 'string' ? (props.textTag ? h(props.textTag, x) : x) : (slots as any)[x.arg]())); }; diff --git a/packages/frontend-embed/src/custom-emojis.ts b/packages/frontend-embed/src/custom-emojis.ts index d5b40885c1..e66a6b3112 100644 --- a/packages/frontend-embed/src/custom-emojis.ts +++ b/packages/frontend-embed/src/custom-emojis.ts @@ -45,11 +45,11 @@ export async function fetchCustomEmojis(force = false) { set('lastEmojisFetchedAt', now); } -let cachedTags; +let cachedTags: string[] | null = null; export function getCustomEmojiTags() { if (cachedTags) return cachedTags; - const tags = new Set(); + const tags = new Set(); for (const emoji of customEmojis.value) { for (const tag of emoji.aliases) { tags.add(tag);