Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…inoco into develop
  • Loading branch information
today-is-first committed Nov 28, 2024
2 parents 8240fa3 + 904b4ec commit 62858c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function MainDisplay() {
const { gameStartData, currentSpeaker, endSpeaking, votePinoco } = useGameSocket(setGamePhase);
const { endingResult } = useEnding(setGamePhase);
const { submitGuess } = useGuessing(isPinoco, setGamePhase);
const { voteResult, deadPerson } = useVoteResult(
const { voteResult, deadPerson, isDeadPersonPinoco } = useVoteResult(
setIsVoteSubmitted,
setGamePhase,
setSelectedVote,
Expand Down Expand Up @@ -118,7 +118,11 @@ export default function MainDisplay() {
)}

{gamePhase === GAME_PHASE.VOTING_RESULT && (
<VoteResult deadPerson={deadPerson ?? ''} voteResult={voteResult} isPinoco={isPinoco} />
<VoteResult
deadPerson={deadPerson ?? ''}
voteResult={voteResult}
isDeadPersonPinoco={isDeadPersonPinoco ?? null}
/>
)}
{gamePhase === GAME_PHASE.GUESSING && (
<div className="flex flex-col items-center justify-center h-full">
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/hooks/useVoteResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function useVoteResult(
const { removeUser } = useRoomStore();
const [voteResult, setVoteResult] = useState<Record<string, number>>({});
const [deadPerson, setDeadPerson] = useState<string | null>(null);
const [isDeadPersonPinoco, setIsDeadPersonPinoco] = useState<boolean | null>(null); // 추가
const [isDeadPersonPinoco, setIsDeadPersonPinoco] = useState<boolean | null>(null);

useEffect(() => {
if (!socket) return;
Expand All @@ -33,7 +33,7 @@ export default function useVoteResult(

setVoteResult(data.voteResult);
setDeadPerson(data.deadPerson);
setIsDeadPersonPinoco(data.isDeadPersonPinoco); // 추가
setIsDeadPersonPinoco(data.isDeadPersonPinoco);

if (setSelectedVote) {
setSelectedVote(null);
Expand All @@ -48,5 +48,5 @@ export default function useVoteResult(
};
}, [socket, onIsVotedChange, onPhaseChange, removeUser, setSelectedVote]);

return { voteResult, deadPerson, isDeadPersonPinoco }; // 수정
return { voteResult, deadPerson, isDeadPersonPinoco };
}

0 comments on commit 62858c9

Please sign in to comment.