From ed68cd5b380fdfe399de29442b2e791e2efc1e9e Mon Sep 17 00:00:00 2001 From: eduardozgz Date: Wed, 16 Oct 2024 17:48:03 +0200 Subject: [PATCH] remove todo --- .../app/components/LandingPage/DiscordDemo/index.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/website/src/app/components/LandingPage/DiscordDemo/index.tsx b/apps/website/src/app/components/LandingPage/DiscordDemo/index.tsx index 85f952a68..8833ba59f 100644 --- a/apps/website/src/app/components/LandingPage/DiscordDemo/index.tsx +++ b/apps/website/src/app/components/LandingPage/DiscordDemo/index.tsx @@ -9,7 +9,6 @@ import { serverListColor } from "./colors"; import { DescriptionArea } from "./DescriptionArea"; import { ServerNavMenu } from "./ServerNavMenu"; -// TODO fetch from backend export function DiscordDemo() { const [mouseIsHovering, setMouseIsHovering] = useState(false); const [selectedServerIndex, setSelectedServerIndex] = useState(0); @@ -29,15 +28,15 @@ export function DiscordDemo() { clearInterval(serverSelection); }; } - }, [mouseIsHovering, selectedServerIndex]); + }, [demoServers.length, mouseIsHovering, selectedServerIndex]); useEffect(() => { if (!selectedServer) return; setSelectedChannelIndex( - selectedServer.channels.findIndex( - (channel) => - channel.type === ChannelType.GuildText || - channel.type === ChannelType.GuildAnnouncement, + selectedServer.channels.findIndex((channel) => + [ChannelType.GuildText, ChannelType.GuildAnnouncement].includes( + channel.type, + ), ), ); }, [selectedServer]);