feat(game): enhance game reconnection logic and improve reset messages

This commit is contained in:
Ralex
2025-10-25 16:38:07 +02:00
parent dbefaa0557
commit 74707749aa
11 changed files with 114 additions and 76 deletions

View File

@@ -12,7 +12,7 @@ import Image from "next/image"
import { PropsWithChildren } from "react"
type Props = PropsWithChildren & {
statusName: Status
statusName: Status | undefined
onNext?: () => void
manager?: boolean
}
@@ -21,7 +21,7 @@ const GameWrapper = ({ children, statusName, onNext, manager }: Props) => {
const { isConnected } = useSocket()
const { player } = usePlayerStore()
const { questionStates, setQuestionStates } = useQuestionStore()
const next = MANAGER_SKIP_BTN[statusName] || null
const next = statusName ? MANAGER_SKIP_BTN[statusName] : null
useEvent("game:updateQuestion", ({ current, total }) => {
setQuestionStates({