11'use client' ;
22
3- import { useGetRoomStatusFirebaseRoomRoomIdGet } from '@/app/api/room/hooks/useQueryRoom' ;
43import { GlobalContext } from '@/app/GlobalContext' ;
54import {
65 ALERT ,
@@ -89,14 +88,9 @@ export const ChatProvider = ({ children }: { children: ReactNode }) => {
8988 const [ background , setBackground ] =
9089 useState < ChatContextType [ 'background' ] > ( null ) ;
9190 const [ votedId , setVotedId ] = useState < string | null > ( null ) ;
92- const { data : currentRoom } = useGetRoomStatusFirebaseRoomRoomIdGet ( {
93- roomId,
94- isConnecting,
95- } ) ;
9691 const [ currentUserList , setCurrentUserList ] = useState < User [ ] > ( [ ] ) ;
9792 const [ roomInfo , setRoomInfo ] = useState < RoomModel | null > ( null ) ;
9893 const [ gameInfo , setGameInfo ] = useState < GameInfoMessage | null > ( null ) ;
99- const isGameStarted = currentRoom ?. RoomState ;
10094
10195 const handleClearGame = ( ) => {
10296 setCanSpeak ( true ) ;
@@ -116,9 +110,6 @@ export const ChatProvider = ({ children }: { children: ReactNode }) => {
116110
117111 useEffect ( ( ) => {
118112 // 게임이 시작 되지 않은 상태(대기실)면, 말할 수 있음
119- if ( ! isGameStarted ) {
120- setCanSpeak ( true ) ;
121- }
122113
123114 if ( ! roomId || ! userId || isConnecting || wsRef . current ) return ;
124115
@@ -130,6 +121,8 @@ export const ChatProvider = ({ children }: { children: ReactNode }) => {
130121 return ;
131122 }
132123
124+ console . log ( roomName ) ;
125+
133126 wsRef . current = new WebSocket (
134127 // `ws://localhost:8000/ws/room/${roomId}/${userId}/${roomName}`
135128 `wss://wam-coin.store/ws/room/${ roomId } /${ userId } /${ roomName } `
@@ -239,7 +232,7 @@ export const ChatProvider = ({ children }: { children: ReactNode }) => {
239232 }
240233 setIsConnecting ( false ) ;
241234 } ;
242- } , [ roomId , userId , isConnecting , currentRoom ] ) ;
235+ } , [ roomId , userId , isConnecting ] ) ;
243236
244237 const handleChangeUserMemo : ChatContextType [ 'handleChangeUserMemo' ] = (
245238 userID
0 commit comments