From ca96cb9bceb6df0f1ee1376ea7fbd79bd3502f3c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Tue, 5 Mar 2024 15:28:52 -0500 Subject: [PATCH] fix empty list not rendering when no active channel --- src/components/ChannelList/ChannelList.tsx | 6 +----- src/components/ChannelSidebar.tsx | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/ChannelList/ChannelList.tsx b/src/components/ChannelList/ChannelList.tsx index 7276a41..8258079 100644 --- a/src/components/ChannelList/ChannelList.tsx +++ b/src/components/ChannelList/ChannelList.tsx @@ -10,14 +10,10 @@ const Container = styled.div` flex: 1; `; -export function EmptyChannelList() { - return ; -} - function ChannelList() { const app = useAppStore(); - if (!app.activeGuild || !app.activeChannel) return null; + if (!app.activeGuild || !app.activeChannel) return ; const { channels } = app.activeGuild; const rowRenderer = ({ index, key, style }: ListRowProps) => { diff --git a/src/components/ChannelSidebar.tsx b/src/components/ChannelSidebar.tsx index 99f327b..4e2d8e2 100644 --- a/src/components/ChannelSidebar.tsx +++ b/src/components/ChannelSidebar.tsx @@ -1,8 +1,7 @@ import { observer } from "mobx-react-lite"; import styled from "styled-components"; -import { useAppStore } from "../stores/AppStore"; import ChannelHeader from "./ChannelHeader"; -import ChannelList, { EmptyChannelList } from "./ChannelList/ChannelList"; +import ChannelList from "./ChannelList/ChannelList"; import Container from "./Container"; import UserPanel from "./UserPanel"; @@ -18,13 +17,11 @@ const Wrapper = styled(Container)` `; function ChannelSidebar() { - const app = useAppStore(); - return ( {/* TODO: replace with dm search if no guild */} - {app.activeGuild ? : } + );