このコミットが含まれているのは:
2026-10-17 16:47:08 +09:00
コミット b945ceef60
91個のファイルの変更、4652行の追加、822行の削除
+20 -18
ファイルの表示
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Helmet } from 'react-helmet-async'
import { useParams } from 'react-router-dom'
import { useLocale } from '@/lib/useLocale'
import ErrorScreen from '@/components/ErrorScreen'
import PostEditForm from '@/components/PostEditForm'
import PostEmbed from '@/components/PostEmbed'
@@ -215,6 +216,7 @@ type Props = { user: User | null }
const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
const locale = useLocale ()
const behaviourSettings = useClientBehaviourSettings ()
const animationMode = behaviourSettings.animation ?? 'normal'
const layoutTransition = clientAnimationTransition (
@@ -286,16 +288,16 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
return
setProgrammes (await apiGet<TheatreProgramme[]> (
`/theatres/${ id }/programmes`, { params: { limit: '100' } }))
}, [id])
`/theatres/${ id }/programmes`, { locale, params: { limit: '100' } }))
}, [id, locale])
const refreshWeights = useCallback (async () => {
if (!(id))
return
setWeights (await apiGet<TheatrePostSelectionWeights> (
`/theatres/${ id }/post_selection_weights`))
}, [id])
`/theatres/${ id }/post_selection_weights`, { locale }))
}, [id, locale])
const advancePost = useCallback (async () => {
if (!(id))
@@ -304,7 +306,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
setLoading (true)
try
{
await apiPatch<void> (`/theatres/${ id }/next_post`)
await apiPatch<void> (`/theatres/${ id }/next_post`, { }, { locale })
await refreshProgrammes ()
await refreshWeights ()
}
@@ -316,7 +318,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
{
setLoading (false)
}
}, [id, refreshProgrammes, refreshWeights])
}, [id, refreshProgrammes, refreshWeights, locale])
useEffect (() => {
loadingRef.current = loading
@@ -365,7 +367,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
void (async () => {
try
{
const data = await apiGet<Theatre> (`/theatres/${ id }`)
const data = await apiGet<Theatre> (`/theatres/${ id }`, { locale })
if (!(cancelled))
setTheatre (data)
}
@@ -381,7 +383,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
return () => {
cancelled = true
}
}, [id, refreshProgrammes, refreshWeights])
}, [id, refreshProgrammes, refreshWeights, locale])
useEffect (() => {
if (!(id))
@@ -400,7 +402,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
{
const newComments = await apiGet<TheatreComment[]> (
`/theatres/${ id }/comments`,
{ params: { no_gt: lastCommentNoRef.current, limit: '20' } })
{ locale, params: { no_gt: lastCommentNoRef.current, limit: '20' } })
if (!(cancelled) && newComments.length > 0)
{
@@ -433,7 +435,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
}
const watchingRequestedAt = performance.now ()
const nextInfo = await apiPut<TheatreInfo> (`/theatres/${ id }/watching`)
const nextInfo = await apiPut<TheatreInfo> (`/theatres/${ id }/watching`, { }, { locale })
if (!(cancelled) && watchingRequestedAt >= theatreInfoReceivedAtRef.current)
applyTheatreInfo (nextInfo)
}
@@ -454,7 +456,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
cancelled = true
clearInterval (interval)
}
}, [applyTheatreInfo, currentPostElapsedMs, id])
}, [applyTheatreInfo, currentPostElapsedMs, id, locale])
useEffect (() => {
if (!(id) || !(theatreInfo.hostFlg) || loadingRef.current || theatreInfo.postId != null)
@@ -487,7 +489,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
void (async () => {
try
{
const nextPost = await fetchPost (String (theatreInfo.postId))
const nextPost = await fetchPost (String (theatreInfo.postId), locale)
if (!(cancelled))
setPost (nextPost)
}
@@ -500,7 +502,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
return () => {
cancelled = true
}
}, [theatreInfo.postId])
}, [theatreInfo.postId, locale])
useEffect (() => {
void refreshProgrammes ()
@@ -570,9 +572,9 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
const nextInfo =
theatreInfo.skipVote.voted
? await apiDelete<TheatreInfo> (
`/theatres/${ id }/skip_vote`, { params: { post_id: post.id } })
`/theatres/${ id }/skip_vote`, { locale, params: { post_id: post.id } })
: await apiPut<TheatreInfo> (
`/theatres/${ id }/skip_vote`, { post_id: post.id })
`/theatres/${ id }/skip_vote`, { post_id: post.id }, { locale })
applyTheatreInfo (nextInfo)
@@ -586,7 +588,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
catch (error)
{
if (isApiError (error) && error.response?.status === 409)
applyTheatreInfo (await apiPut<TheatreInfo> (`/theatres/${ id }/watching`))
applyTheatreInfo (await apiPut<TheatreInfo> (`/theatres/${ id }/watching`, { }, { locale }))
console.error (error)
}
@@ -600,7 +602,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
const handleDelete = async (commentNo: number) => {
try
{
await apiDelete (`/theatres/${ id }/comments/${ commentNo }`)
await apiDelete (`/theatres/${ id }/comments/${ commentNo }`, { locale })
setComments (prev => {
const rtn = [...prev]
const idx = rtn.findIndex (x => x.no === commentNo)
@@ -625,7 +627,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
{
setSending (true)
clearValidationErrors ()
await apiPost (`/theatres/${ id }/comments`, { content })
await apiPost (`/theatres/${ id }/comments`, { content }, { locale })
setContent ('')
commentsRef.current?.scrollTo ({
top: 0,