Skip to content

Commit

Permalink
fix : 서버 연결 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayreeel committed Aug 4, 2023
1 parent a5e1038 commit ea3a651
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions frontend/src/pages/PlayerRoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PlayerRoomPage = observer(() => {

const navigate = useNavigate();
const param = useParams();
const { send, error, ws } = WebsocketStore;
const { send, error } = WebsocketStore;
const [IsmodalEOpen, SetismodalEOpen] = useState(false);
const [ValueLengthState, SetValueState] = useState("");
const [HintState, SetHintState] = useState("");
Expand Down Expand Up @@ -151,7 +151,7 @@ const PlayerRoomPage = observer(() => {

if (
roomstate.findIndex(
(item) => !(item.playerId === myId) && item.playerName === inputValue,
(item) => !(item.playerId === myId) && item.playerName === inputValue
) !== -1
) {
SetValueState("동일한 닉네임이 존재해요!");
Expand Down Expand Up @@ -191,13 +191,6 @@ const PlayerRoomPage = observer(() => {
}
}, [error]);

useEffect(() => {
if (!ws) {
alert("서버와의 연결이 끊어졌습니다.");
window.location.href = "/";
}
}, [ws]);

return (
<div className="relative h-screen w-screen bg-[#E7F5FF] flex justify-center items-center overflow-hidden">
<img src={sketch} alt="sketch" className="absolute z-10 pb-[60px]" />
Expand Down Expand Up @@ -251,7 +244,7 @@ const PlayerRoomPage = observer(() => {
)}
</div>
</div>
),
)
)}
<button
className="relative"
Expand Down

0 comments on commit ea3a651

Please sign in to comment.