From b6a9f12d2b4314d2319b1f6aab9f001f6b36ce0f Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Mon, 18 Dec 2023 11:59:56 -0500 Subject: [PATCH] destructure props in Chat.tsx --- src/components/messaging/Chat.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/messaging/Chat.tsx b/src/components/messaging/Chat.tsx index 1924bd0..a7300cf 100644 --- a/src/components/messaging/Chat.tsx +++ b/src/components/messaging/Chat.tsx @@ -80,16 +80,17 @@ const Content = observer((props: Props2) => { function Chat() { const app = useAppStore(); const logger = useLogger("Messages"); + const { activeChannel, activeGuild, activeChannelId, activeGuildId } = app; React.useEffect(() => { - if (!app.activeChannel || !app.activeGuild || app.activeChannelId === "@me") return; + if (!activeChannel || !activeGuild || activeChannelId === "@me") return; runInAction(() => { - app.gateway.onChannelOpen(app.activeGuildId!, app.activeChannelId!); + app.gateway.onChannelOpen(activeGuildId!, activeChannelId!); }); - }, [app.activeChannel, app.activeGuild]); + }, [activeChannel, activeGuild]); - if (app.activeGuildId && app.activeGuildId === "@me") { + if (activeGuildId && activeGuildId === "@me") { return ( Home Section Placeholder @@ -97,7 +98,7 @@ function Chat() { ); } - if (!app.activeGuild || !app.activeChannel) { + if (!activeGuild || !activeChannel) { return ( - - + + ); }