Skip to content

Commit 5a2c029

Browse files
committed
[FE] feat: voice type 채널 선택시 전역상태 업데이트 (#74)
1 parent 5b5749d commit 5a2c029

File tree

1 file changed

+6
-0
lines changed
  • src/frontend/src/components/guild/GuildCategoriesList

1 file changed

+6
-0
lines changed

src/frontend/src/components/guild/GuildCategoriesList/index.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BiHash } from 'react-icons/bi';
22
import { BsFillMicFill } from 'react-icons/bs';
33
import { TbPlus } from 'react-icons/tb';
44

5+
import { useChannelActionStore } from '@/stores/channelAction';
56
import { GuildChannelInfo, useChannelInfoStore } from '@/stores/channelInfo';
67
import { useGuildInfoStore } from '@/stores/guildInfo';
78
import useModalStore from '@/stores/modalStore';
@@ -20,13 +21,18 @@ const GuildCategoriesList = ({ categories, channels }: CategoriesListProps) => {
2021
const { openModal } = useModalStore();
2122
const { guildId } = useGuildInfoStore();
2223
const { selectedChannel, setSelectedChannel } = useChannelInfoStore();
24+
const { isInVoiceChannel, setIsInVoiceChannel } = useChannelActionStore();
2325

2426
const handleOpenModal = (categoryId: string, guildId: string) => {
2527
openModal('withFooter', <CreateChannelModal categoryId={categoryId} guildId={guildId} />);
2628
};
2729

2830
const handleChannelClick = (channelInfo: GuildChannelInfo) => {
2931
setSelectedChannel({ id: channelInfo.id, name: channelInfo.name, type: channelInfo.type });
32+
33+
if (channelInfo.type === 'VOICE') {
34+
if (!isInVoiceChannel) setIsInVoiceChannel();
35+
}
3036
};
3137

3238
return (

0 commit comments

Comments
 (0)