From 09a5e4b10aad85d27875f3cdc8f32bd820615978 Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 3 Jul 2025 11:20:26 +0900 Subject: fix(frontend): Paginatorの型エラー解消 (#16230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): fix paginator type error * fix * refactor * fix * fix * fix(paginator): remove readonly type * fix * typo * fix: R -> E * remove any --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- .../src/components/MkStreamingNotesTimeline.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'packages/frontend/src/components/MkStreamingNotesTimeline.vue') diff --git a/packages/frontend/src/components/MkStreamingNotesTimeline.vue b/packages/frontend/src/components/MkStreamingNotesTimeline.vue index 6e87c02949..b697e18f79 100644 --- a/packages/frontend/src/components/MkStreamingNotesTimeline.vue +++ b/packages/frontend/src/components/MkStreamingNotesTimeline.vue @@ -75,6 +75,7 @@ import { i18n } from '@/i18n.js'; import { globalEvents, useGlobalEvent } from '@/events.js'; import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js'; import { Paginator } from '@/utility/paginator.js'; +import type { IPaginator, MisskeyEntity } from '@/utility/paginator.js'; const props = withDefaults(defineProps<{ src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role'; @@ -101,12 +102,12 @@ provide('inTimeline', true); provide('tl_withSensitive', computed(() => props.withSensitive)); provide('inChannel', computed(() => props.src === 'channel')); -let paginator: Paginator; +let paginator: IPaginator; if (props.src === 'antenna') { paginator = markRaw(new Paginator('antennas/notes', { computedParams: computed(() => ({ - antennaId: props.antenna, + antennaId: props.antenna!, })), useShallowRef: true, })); @@ -160,21 +161,21 @@ if (props.src === 'antenna') { computedParams: computed(() => ({ withRenotes: props.withRenotes, withFiles: props.onlyFiles ? true : undefined, - listId: props.list, + listId: props.list!, })), useShallowRef: true, })); } else if (props.src === 'channel') { paginator = markRaw(new Paginator('channels/timeline', { computedParams: computed(() => ({ - channelId: props.channel, + channelId: props.channel!, })), useShallowRef: true, })); } else if (props.src === 'role') { paginator = markRaw(new Paginator('roles/notes', { computedParams: computed(() => ({ - roleId: props.role, + roleId: props.role!, })), useShallowRef: true, })); @@ -259,7 +260,7 @@ function releaseQueue() { scrollToTop(rootEl.value); } -function prepend(note: Misskey.entities.Note) { +function prepend(note: Misskey.entities.Note & MisskeyEntity) { adInsertionCounter++; if (instance.notesPerOneAd > 0 && adInsertionCounter % instance.notesPerOneAd === 0) { @@ -281,12 +282,13 @@ function prepend(note: Misskey.entities.Note) { } } -let connection: Misskey.ChannelConnection | null = null; -let connection2: Misskey.ChannelConnection | null = null; +let connection: Misskey.IChannelConnection | null = null; +let connection2: Misskey.IChannelConnection | null = null; const stream = store.s.realtimeMode ? useStream() : null; function connectChannel() { + if (stream == null) return; if (props.src === 'antenna') { if (props.antenna == null) return; connection = stream.useChannel('antenna', { -- cgit v1.2.3-freya