summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkStreamingNotesTimeline.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2025-07-03 11:20:26 +0900
committerGitHub <noreply@github.com>2025-07-03 11:20:26 +0900
commit09a5e4b10aad85d27875f3cdc8f32bd820615978 (patch)
treeb79819b40e0630314522461ea01ef365562fb255 /packages/frontend/src/components/MkStreamingNotesTimeline.vue
parent🎨 (diff)
downloadmisskey-09a5e4b10aad85d27875f3cdc8f32bd820615978.tar.gz
misskey-09a5e4b10aad85d27875f3cdc8f32bd820615978.tar.bz2
misskey-09a5e4b10aad85d27875f3cdc8f32bd820615978.zip
fix(frontend): Paginatorの型エラー解消 (#16230)
* 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>
Diffstat (limited to 'packages/frontend/src/components/MkStreamingNotesTimeline.vue')
-rw-r--r--packages/frontend/src/components/MkStreamingNotesTimeline.vue18
1 files changed, 10 insertions, 8 deletions
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<Misskey.entities.Note>;
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', {