fix type errors

This commit is contained in:
syuilo 2025-07-05 17:13:29 +09:00
parent cc4cdd1ec0
commit f128682200
9 changed files with 14 additions and 9 deletions

View File

@ -51,7 +51,7 @@ export const packedFlashSchema = {
},
likedCount: {
type: 'number',
optional: false, nullable: true,
optional: false, nullable: false,
},
isLiked: {
type: 'boolean',

View File

@ -41,7 +41,7 @@ import { i18n } from '@/i18n.js';
const props = withDefaults(defineProps<{
role: Misskey.entities.Role;
forModeration: boolean;
detailed: boolean;
detailed?: boolean;
}>(), {
detailed: true,
});

View File

@ -25,7 +25,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
import { definePage } from '@/page.js';
const props = defineProps<{
messageId?: string;
messageId: string;
}>();
const initializing = ref(true);

View File

@ -197,7 +197,7 @@ async function initialize() {
connection.value.on('deleted', onDeleted);
connection.value.on('react', onReact);
connection.value.on('unreact', onUnreact);
} else {
} else if (props.roomId) {
const [rResult, mResult] = await Promise.allSettled([
misskeyApi('chat/rooms/show', { roomId: props.roomId }),
misskeyApi('chat/messages/room-timeline', { roomId: props.roomId, limit: LIMIT }),

View File

@ -67,7 +67,7 @@ const router = useRouter();
const tab = ref('featured');
const searchQuery = ref('');
const searchPaginator = shallowRef<IPaginator | null>(null);
const searchPaginator = shallowRef<Paginator<'flash/search'> | null>(null);
const searchKey = ref(0);
const featuredFlashsPaginator = markRaw(new Paginator('flash/featured', {

View File

@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_s">
<MkKeyValue>
<template #key>{{ i18n.ts._externalResourceInstaller._vendorInfo.endpoint }}</template>
<template #value><MkUrl :url="url" :showUrlPreview="false"></MkUrl></template>
<template #value><MkUrl v-if="url" :url="url" :showUrlPreview="false"></MkUrl></template>
</MkKeyValue>
<MkKeyValue>
<template #key>{{ i18n.ts._externalResourceInstaller._vendorInfo.hashVerify }}</template>
@ -151,7 +151,7 @@ async function fetch() {
case 'theme':
try {
const metaRaw = parseThemeCode(res.data);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { id, props, desc: description, ...meta } = metaRaw;
data.value = {
type: 'theme',

View File

@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="instance" class="_spacer" style="--MI_SPACER-w: 600px; --MI_SPACER-min: 16px; --MI_SPACER-max: 32px;">
<div v-if="tab === 'overview'" class="_gaps_m">
<div :class="$style.faviconAndName">
<img :src="faviconUrl" alt="" :class="$style.icon"/>
<img v-if="faviconUrl" :src="faviconUrl" alt="" :class="$style.icon"/>
<span :class="$style.name">{{ instance.name || `(${i18n.ts.unknown})` }}</span>
</div>
<div style="display: flex; flex-direction: column; gap: 1em;">

View File

@ -62,24 +62,29 @@ function fetchList(): void {
}
function like() {
if (list.value == null) return;
os.apiWithDialog('users/lists/favorite', {
listId: list.value.id,
}).then(() => {
if (list.value == null) return;
list.value.isLiked = true;
list.value.likedCount++;
});
}
function unlike() {
if (list.value == null) return;
os.apiWithDialog('users/lists/unfavorite', {
listId: list.value.id,
}).then(() => {
if (list.value == null) return;
list.value.isLiked = false;
list.value.likedCount--;
});
}
async function create() {
if (list.value == null) return;
const { canceled, result: name } = await os.inputText({
title: i18n.ts.enterListName,
});

View File

@ -5077,7 +5077,7 @@ export type components = {
script: string;
/** @enum {string} */
visibility: 'private' | 'public';
likedCount: number | null;
likedCount: number;
isLiked?: boolean;
};
Signin: {