From cf7044c034fe201fc16888096c03e0d5416e341b Mon Sep 17 00:00:00 2001 From: juwon5272 Date: Wed, 26 Feb 2025 18:21:32 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[FE]=20FIX:=20myRole,=20roomId=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=98=A4=EB=8A=94=20=EB=B0=A9=EB=B2=95=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20#256?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/Sidebar/UserList/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/Sidebar/UserList/index.tsx b/src/frontend/src/components/Sidebar/UserList/index.tsx index c6e89e3e..10a8cc1e 100644 --- a/src/frontend/src/components/Sidebar/UserList/index.tsx +++ b/src/frontend/src/components/Sidebar/UserList/index.tsx @@ -5,7 +5,6 @@ import { RedBlackTree } from '@/hooks/utils/RedBlackTree'; import { SidebarType } from '@/types/enums/SidebarType'; import { ProfileType } from '@/types/enums/ProfileType'; -import { UserRole } from '@/types/enums/UserRole'; import { roomApi } from '@/api/endpoints/room/room.api'; import { useWebSocketStore } from '@/stores/useWebSocketStore'; @@ -31,8 +30,8 @@ const compareUsers = (a: IUser, b: IUser): number => { export const UserList = () => { const treeRef = useRef | null>(null); const [, setVersion] = useState(0); - const { currentRoom } = useCurrentRoomStore(); - const roomId = currentRoom?.roomDetails.roomInfo[0]?.roomId; + const currentRoom = useCurrentRoomStore(state => state.currentRoom); + const roomId = useCurrentRoomStore(state => state.roomId); const { subscribeRoomUserInfo, subscribeRoomRoleChange } = useWebSocketStore.getState(); useEffect(() => { @@ -132,7 +131,7 @@ export const UserList = () => { nickname={member.nickname} imgUrl={member.profileImg} userRole={member.role} - myRole={UserRole.CREATOR} + myRole={currentRoom?.myRole || 2} sidebarType={SidebarType.USERLIST} onCancel={() => setActiveProfile(null)} /> From d955e7af53f5c8886b5c105bef9dbe16cb76ee7c Mon Sep 17 00:00:00 2001 From: juwon5272 Date: Wed, 26 Feb 2025 18:22:00 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[FE]=20FIX:=20myRole,=20roomId=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=98=A4=EB=8A=94=20=EB=B0=A9=EB=B2=95=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20#256?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/Sidebar/VoiceChat/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/Sidebar/VoiceChat/index.tsx b/src/frontend/src/components/Sidebar/VoiceChat/index.tsx index 6392846c..547edb2d 100644 --- a/src/frontend/src/components/Sidebar/VoiceChat/index.tsx +++ b/src/frontend/src/components/Sidebar/VoiceChat/index.tsx @@ -4,7 +4,6 @@ import { UserListFooter } from '@/components/Sidebar/UserList/UserListFooter'; import { SidebarType } from '@/types/enums/SidebarType'; import { ProfileType } from '@/types/enums/ProfileType'; -import { UserRole } from '@/types/enums/UserRole'; import { Container, UserList, ProfileWrapper } from './index.css'; import { CurrentRoomUserDto } from '@/api/endpoints/room/room.interface'; @@ -12,8 +11,9 @@ import { RoomProfileModal } from '@/components/Modal/RoomProfileModal'; import { useCurrentRoomStore } from '@/stores/useCurrentRoomStore'; export const VoiceChat = () => { const [activeProfile, setActiveProfile] = useState(null); - const { currentRoom } = useCurrentRoomStore(); - const roomId = currentRoom?.roomDetails.roomInfo[0]?.roomId; + + const currentRoom = useCurrentRoomStore(state => state.currentRoom); + const roomId = useCurrentRoomStore(state => state.roomId); const handleProfileClick = (id: number) => { setActiveProfile(prevId => (prevId === id ? null : id)); }; @@ -46,7 +46,7 @@ export const VoiceChat = () => { imgUrl={member.profileImageUrl} userId={member.userId} userRole={member.role} - myRole={UserRole.CREATOR} + myRole={currentRoom?.myRole || 2} sidebarType={SidebarType.VOICECHAT} roomId={roomId} onCancel={() => setActiveProfile(null)} From 98f5c9ce20b74c298d4bffb95a91cfcb41fe6195 Mon Sep 17 00:00:00 2001 From: juwon5272 Date: Wed, 26 Feb 2025 18:22:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[FE]=20FIX:=20myRole,=20roomId=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=98=A4=EB=8A=94=20=EB=B0=A9=EB=B2=95=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20#256?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/YoutubePlayer/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/YoutubePlayer/index.tsx b/src/frontend/src/components/YoutubePlayer/index.tsx index 6f6dcf8e..5089e6e8 100644 --- a/src/frontend/src/components/YoutubePlayer/index.tsx +++ b/src/frontend/src/components/YoutubePlayer/index.tsx @@ -7,10 +7,11 @@ import { UserRole } from '@/types/enums/UserRole'; export const YouTubePlayer = () => { const { videoQueue } = useVideoStore(); - const { roomId } = useCurrentRoomStore.getState(); + const currentRoom = useCurrentRoomStore(state => state.currentRoom); + const myRole = currentRoom?.myRole; + const roomId = useCurrentRoomStore(state => state.roomId); const { client, subTopic } = useWebSocketStore(); const pubTopic = useWebSocketStore.getState().pubTopic; - const myRole = useCurrentRoomStore.getState().currentRoom?.myRole; const isWatchOnly = myRole === UserRole.MEMBER; const playerRef = useRef(null);