File tree 1 file changed +6
-0
lines changed
src/frontend/src/components/guild/GuildCategoriesList
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { BiHash } from 'react-icons/bi';
2
2
import { BsFillMicFill } from 'react-icons/bs' ;
3
3
import { TbPlus } from 'react-icons/tb' ;
4
4
5
+ import { useChannelActionStore } from '@/stores/channelAction' ;
5
6
import { GuildChannelInfo , useChannelInfoStore } from '@/stores/channelInfo' ;
6
7
import { useGuildInfoStore } from '@/stores/guildInfo' ;
7
8
import useModalStore from '@/stores/modalStore' ;
@@ -20,13 +21,18 @@ const GuildCategoriesList = ({ categories, channels }: CategoriesListProps) => {
20
21
const { openModal } = useModalStore ( ) ;
21
22
const { guildId } = useGuildInfoStore ( ) ;
22
23
const { selectedChannel, setSelectedChannel } = useChannelInfoStore ( ) ;
24
+ const { isInVoiceChannel, setIsInVoiceChannel } = useChannelActionStore ( ) ;
23
25
24
26
const handleOpenModal = ( categoryId : string , guildId : string ) => {
25
27
openModal ( 'withFooter' , < CreateChannelModal categoryId = { categoryId } guildId = { guildId } /> ) ;
26
28
} ;
27
29
28
30
const handleChannelClick = ( channelInfo : GuildChannelInfo ) => {
29
31
setSelectedChannel ( { id : channelInfo . id , name : channelInfo . name , type : channelInfo . type } ) ;
32
+
33
+ if ( channelInfo . type === 'VOICE' ) {
34
+ if ( ! isInVoiceChannel ) setIsInVoiceChannel ( ) ;
35
+ }
30
36
} ;
31
37
32
38
return (
You can’t perform that action at this time.
0 commit comments