mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-25 08:35:02 +02:00
fix: frontend-embedで見つけた型エラーの修正 (#17650)
This commit is contained in:
@@ -149,7 +149,7 @@ const isRenote = Misskey.note.isPureRenote(note.value);
|
||||
|
||||
const rootEl = shallowRef<HTMLElement>();
|
||||
const renoteTime = shallowRef<HTMLElement>();
|
||||
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, []);
|
||||
|
||||
@@ -244,7 +244,7 @@ const fetchMore = async (): Promise<void> => {
|
||||
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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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]()));
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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<string>();
|
||||
for (const emoji of customEmojis.value) {
|
||||
for (const tag of emoji.aliases) {
|
||||
tags.add(tag);
|
||||
|
||||
Reference in New Issue
Block a user