mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 13:05:57 +02:00
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>
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user