Skip to content

Commit

Permalink
[🪽 FEAT] backtoLobby클릭시 테마음악 재생기능추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bishoe01 committed Jul 18, 2024
1 parent 2114cbc commit 9a296de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handtris/src/components/GameResultModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import CountUp from "react-countup";
import { getRoomCode } from "@/util/getRoomCode";
import { WebSocketManager } from "./WebSocketManager";
import { useMusic } from "./MusicProvider";
interface GameResultModalProps {
result: "WIN" | "LOSE";
onPlayAgain: () => void;
Expand All @@ -35,7 +36,7 @@ const GameResultModal: React.FC<GameResultModalProps> = ({
const router = useRouter();
const [playerStats, setPlayerStats] = useState<PlayerStats | null>(null);
const [prevWinRate, setPrevWinRate] = useState<number | null>(null);

const { toggleMusic } = useMusic();
const handleBackToLobby = () => {
const roomCode = getRoomCode();
if (roomCode && wsManager && wsManager.connected) {
Expand All @@ -48,7 +49,7 @@ const GameResultModal: React.FC<GameResultModalProps> = ({
}
sessionStorage.removeItem("roomCode");
sessionStorage.removeItem("roomName");

toggleMusic();
router.push("/lobby?refresh=true");
};
useEffect(() => {
Expand Down

0 comments on commit 9a296de

Please sign in to comment.