This commit is contained in:
Xeltica 2023-04-29 14:04:30 +09:00
parent d9a9072bd0
commit 34b4507e14
3 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,6 @@ import { misskeySessionDtoSchema } from '../dto/misskey-session';
import { prisma } from '@/libs/prisma';
import { sessionProcedure } from '@/server/api/procedures/session.js';
import { router } from '@/server/api/trpc.js';
import { delay } from '@/utils/delay';
export const accountRouter = router({
@ -19,7 +18,6 @@ export const accountRouter = router({
getMisskeySessions: sessionProcedure
.output(z.array(misskeySessionDtoSchema))
.query(async ({ ctx }) => {
await delay(1000);
const sessions = await prisma.misskeySession.findMany({
where: { accountId: ctx.account.id },
select: {

View File

@ -3,6 +3,8 @@ import { useTranslation } from 'react-i18next';
import { WidgetBase } from './WidgetBase';
import { SuspenseView } from '@/components/primitives/SuspenseView';
export interface WidgetDef {
name: string;
iconClass: string;
@ -17,7 +19,9 @@ export const widget = (name: string, iconClass: string, pale: boolean, render: R
const { t } = useTranslation();
return (
<WidgetBase title={pale ? undefined : (t('_widgets.' + name) ?? '')} iconClass={pale ? undefined : iconClass} pale={pale}>
{render({})}
<SuspenseView>
{render({})}
</SuspenseView>
</WidgetBase>
);
},

View File

@ -1,5 +1,5 @@
import dayjs from 'dayjs';
import 'dayjs/locale/ja';
import relativeTime from 'dayjs/plugin/relativeTime';
import 'dayjs/locale/ja';
dayjs.extend(relativeTime);