このコミットが含まれているのは:
2026-10-18 13:56:03 +09:00
コミット bbee83e35b
21個のファイルの変更、468行の追加、236行の削除
+11 -17
ファイルの表示
@@ -11,8 +11,8 @@ import { localeFromPath, localeLanguage, unlocalisedPath } from '@/lib/locales'
import { fetchPost, fetchPosts, fetchPostChanges } from '@/lib/posts'
import { helpKeys, postsKeys, tagsKeys, wikiKeys } from '@/lib/queryKeys'
import { fetchNicoTags, fetchTagByName, fetchTag, fetchTagChanges, fetchTags } from '@/lib/tags'
import { fetchWikiPage,
fetchWikiPageByTitle,
import { fetchWikiAutolinkCandidates,
fetchWikiPageByReference,
fetchWikiPages } from '@/lib/wiki'
import type { LocaleCode } from '@/lib/locales'
@@ -114,22 +114,16 @@ const prefetchWikiPageShow: Prefetcher = async (qc, url, locale) => {
const wikiPage = await qc.fetchQuery ({
queryKey: wikiKeys.show (title, { version }, locale),
queryFn: () => fetchWikiPageByTitle (title, { version }, locale) })
queryFn: () => fetchWikiPageByReference (title, { version }, locale) })
if (wikiPage)
{
const effectiveId = String (wikiPage.id ?? '')
await qc.prefetchQuery ({
queryKey: wikiKeys.show (effectiveId, { }, locale),
queryFn: () => fetchWikiPage (effectiveId, { }, locale ) })
if (wikiPage.body)
{
await qc.prefetchQuery ({
queryKey: wikiKeys.index ({ }, locale),
queryFn: () => fetchWikiPages ({ }, locale) })
}
}
if (wikiPage?.body)
{
const language = wikiPage.languageCode
?? (wikiPage.resourceType === 'tag_description' ? localeLanguage (locale) : 'und')
await qc.prefetchQuery ({
queryKey: wikiKeys.autolinkCandidates (language, locale),
queryFn: () => fetchWikiAutolinkCandidates (language, locale) })
}
const effectiveTitle = wikiPage?.title ?? title