fix(frontend): serverContextの型エラーを修正 (#15131)

* fix(frontend): serverContextの型エラーを修正

* add comment
This commit is contained in:
かっこかり
2024-12-16 09:03:46 +09:00
committed by GitHub
parent 3e0fcaeca8
commit 0804092426
4 changed files with 15 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
import { getServerContext } from '@/server-context.js';
import { serverContext, assertServerContext } from '@/server-context.js';
const XHome = defineAsyncComponent(() => import('./home.vue'));
const XTimeline = defineAsyncComponent(() => import('./index.timeline.vue'));
@@ -53,7 +53,8 @@ const XFlashs = defineAsyncComponent(() => import('./flashs.vue'));
const XGallery = defineAsyncComponent(() => import('./gallery.vue'));
const XRaw = defineAsyncComponent(() => import('./raw.vue'));
const CTX_USER = getServerContext('user');
// contextは非ログイン状態の情報しかないためログイン時は利用できない
const CTX_USER = $i && assertServerContext(serverContext, 'user') ? serverContext.user : null;
const props = withDefaults(defineProps<{
acct: string;