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);