fix type errors
This commit is contained in:
parent
cc4cdd1ec0
commit
f128682200
|
@ -51,7 +51,7 @@ export const packedFlashSchema = {
|
||||||
},
|
},
|
||||||
likedCount: {
|
likedCount: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
isLiked: {
|
isLiked: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
|
|
@ -41,7 +41,7 @@ import { i18n } from '@/i18n.js';
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
role: Misskey.entities.Role;
|
role: Misskey.entities.Role;
|
||||||
forModeration: boolean;
|
forModeration: boolean;
|
||||||
detailed: boolean;
|
detailed?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
detailed: true,
|
detailed: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
import { definePage } from '@/page.js';
|
import { definePage } from '@/page.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
messageId?: string;
|
messageId: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const initializing = ref(true);
|
const initializing = ref(true);
|
||||||
|
|
|
@ -197,7 +197,7 @@ async function initialize() {
|
||||||
connection.value.on('deleted', onDeleted);
|
connection.value.on('deleted', onDeleted);
|
||||||
connection.value.on('react', onReact);
|
connection.value.on('react', onReact);
|
||||||
connection.value.on('unreact', onUnreact);
|
connection.value.on('unreact', onUnreact);
|
||||||
} else {
|
} else if (props.roomId) {
|
||||||
const [rResult, mResult] = await Promise.allSettled([
|
const [rResult, mResult] = await Promise.allSettled([
|
||||||
misskeyApi('chat/rooms/show', { roomId: props.roomId }),
|
misskeyApi('chat/rooms/show', { roomId: props.roomId }),
|
||||||
misskeyApi('chat/messages/room-timeline', { roomId: props.roomId, limit: LIMIT }),
|
misskeyApi('chat/messages/room-timeline', { roomId: props.roomId, limit: LIMIT }),
|
||||||
|
|
|
@ -67,7 +67,7 @@ const router = useRouter();
|
||||||
const tab = ref('featured');
|
const tab = ref('featured');
|
||||||
|
|
||||||
const searchQuery = ref('');
|
const searchQuery = ref('');
|
||||||
const searchPaginator = shallowRef<IPaginator | null>(null);
|
const searchPaginator = shallowRef<Paginator<'flash/search'> | null>(null);
|
||||||
const searchKey = ref(0);
|
const searchKey = ref(0);
|
||||||
|
|
||||||
const featuredFlashsPaginator = markRaw(new Paginator('flash/featured', {
|
const featuredFlashsPaginator = markRaw(new Paginator('flash/featured', {
|
||||||
|
|
|
@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkKeyValue>
|
<MkKeyValue>
|
||||||
<template #key>{{ i18n.ts._externalResourceInstaller._vendorInfo.endpoint }}</template>
|
<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>
|
||||||
<MkKeyValue>
|
<MkKeyValue>
|
||||||
<template #key>{{ i18n.ts._externalResourceInstaller._vendorInfo.hashVerify }}</template>
|
<template #key>{{ i18n.ts._externalResourceInstaller._vendorInfo.hashVerify }}</template>
|
||||||
|
@ -151,7 +151,7 @@ async function fetch() {
|
||||||
case 'theme':
|
case 'theme':
|
||||||
try {
|
try {
|
||||||
const metaRaw = parseThemeCode(res.data);
|
const metaRaw = parseThemeCode(res.data);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { id, props, desc: description, ...meta } = metaRaw;
|
const { id, props, desc: description, ...meta } = metaRaw;
|
||||||
data.value = {
|
data.value = {
|
||||||
type: 'theme',
|
type: 'theme',
|
||||||
|
|
|
@ -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="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 v-if="tab === 'overview'" class="_gaps_m">
|
||||||
<div :class="$style.faviconAndName">
|
<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>
|
<span :class="$style.name">{{ instance.name || `(${i18n.ts.unknown})` }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; flex-direction: column; gap: 1em;">
|
<div style="display: flex; flex-direction: column; gap: 1em;">
|
||||||
|
|
|
@ -62,24 +62,29 @@ function fetchList(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
function like() {
|
function like() {
|
||||||
|
if (list.value == null) return;
|
||||||
os.apiWithDialog('users/lists/favorite', {
|
os.apiWithDialog('users/lists/favorite', {
|
||||||
listId: list.value.id,
|
listId: list.value.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
if (list.value == null) return;
|
||||||
list.value.isLiked = true;
|
list.value.isLiked = true;
|
||||||
list.value.likedCount++;
|
list.value.likedCount++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function unlike() {
|
function unlike() {
|
||||||
|
if (list.value == null) return;
|
||||||
os.apiWithDialog('users/lists/unfavorite', {
|
os.apiWithDialog('users/lists/unfavorite', {
|
||||||
listId: list.value.id,
|
listId: list.value.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
if (list.value == null) return;
|
||||||
list.value.isLiked = false;
|
list.value.isLiked = false;
|
||||||
list.value.likedCount--;
|
list.value.likedCount--;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function create() {
|
async function create() {
|
||||||
|
if (list.value == null) return;
|
||||||
const { canceled, result: name } = await os.inputText({
|
const { canceled, result: name } = await os.inputText({
|
||||||
title: i18n.ts.enterListName,
|
title: i18n.ts.enterListName,
|
||||||
});
|
});
|
||||||
|
|
|
@ -5077,7 +5077,7 @@ export type components = {
|
||||||
script: string;
|
script: string;
|
||||||
/** @enum {string} */
|
/** @enum {string} */
|
||||||
visibility: 'private' | 'public';
|
visibility: 'private' | 'public';
|
||||||
likedCount: number | null;
|
likedCount: number;
|
||||||
isLiked?: boolean;
|
isLiked?: boolean;
|
||||||
};
|
};
|
||||||
Signin: {
|
Signin: {
|
||||||
|
|
Loading…
Reference in New Issue