diff --git a/web/src/components/ChannelList.tsx b/web/src/components/ChannelList.tsx index c742a7f..4f9fbc5 100644 --- a/web/src/components/ChannelList.tsx +++ b/web/src/components/ChannelList.tsx @@ -3,6 +3,7 @@ import { useServerStore } from '../stores/server.ts'; import { useChannelStore } from '../stores/channel.ts'; import { VoiceChannel } from './VoiceChannel.tsx'; import { CreateChannelModal } from './CreateChannelModal.tsx'; +import { InviteModal } from './InviteModal.tsx'; export function ChannelList() { const activeServerId = useServerStore((state) => state.activeServerId); @@ -12,6 +13,7 @@ export function ChannelList() { const activeChannelId = useChannelStore((state) => state.activeChannelId); const setActiveChannel = useChannelStore((state) => state.setActiveChannel); const [showCreate, setShowCreate] = useState(false); + const [showInvite, setShowInvite] = useState(false); useEffect(() => { if (activeServerId) { @@ -47,13 +49,22 @@ export function ChannelList() {
{activeServerId ? `[SERVER ${activeServer?.name ?? activeServerId}]` : '[NO SERVER]'} {activeServerId && ( - +
+ + +
)}
@@ -90,6 +101,9 @@ export function ChannelList() { {showCreate && activeServerId && ( setShowCreate(false)} /> )} + {showInvite && activeServerId && activeServer && ( + setShowInvite(false)} /> + )}
); } diff --git a/web/src/components/VoiceChannel.tsx b/web/src/components/VoiceChannel.tsx index 23a6aaa..5b27886 100644 --- a/web/src/components/VoiceChannel.tsx +++ b/web/src/components/VoiceChannel.tsx @@ -15,12 +15,20 @@ export function VoiceChannel({ channelId, channelName }: VoiceChannelProps) { const handleClick = () => { if (!isActive) { - joinVoice(channelId, channelName); + console.log("[VoiceChannel] joining voice:", channelId, channelName); + joinVoice(channelId, channelName).catch((err) => { + console.error("[VoiceChannel] joinVoice failed:", err); + }); } }; + const error = useVoiceStore((state) => state.error); + return (
+ {error && ( +
! {error}
+ )}