Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/frontend/src/components/Sidebar/UserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -31,8 +30,8 @@ const compareUsers = (a: IUser, b: IUser): number => {
export const UserList = () => {
const treeRef = useRef<RedBlackTree<IUser> | 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(() => {
Expand Down Expand Up @@ -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)}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/src/components/Sidebar/VoiceChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ 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';
import { RoomProfileModal } from '@/components/Modal/RoomProfileModal';
import { useCurrentRoomStore } from '@/stores/useCurrentRoomStore';
export const VoiceChat = () => {
const [activeProfile, setActiveProfile] = useState<number | null>(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));
};
Expand Down Expand Up @@ -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)}
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/src/components/YoutubePlayer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

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<YT.Player | null>(null);
Expand Down Expand Up @@ -176,7 +177,7 @@
// 동일 영상 id라면 재생 다시 시작 안 함
console.log('같은 영상입니다');
}
}, [videoQueue, currentPlayingVideo]);

Check warning on line 180 in src/frontend/src/components/YoutubePlayer/index.tsx

View workflow job for this annotation

GitHub Actions / frontend-ci

React Hook useEffect has a missing dependency: 'loadPlayer'. Either include it or remove the dependency array

return (
<Container>
Expand Down
Loading