From fc1c550a2ef4131ef4697b295d82a50f44456377 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Thu, 20 Aug 2026 10:24:13 +0200 Subject: [PATCH] Fix recursion --- src/components/page/PageView.tsx | 5 ++--- src/components/page/channel/ChannelPage.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/page/PageView.tsx b/src/components/page/PageView.tsx index 311fe5a..9dfb093 100644 --- a/src/components/page/PageView.tsx +++ b/src/components/page/PageView.tsx @@ -14,11 +14,10 @@ export default function Page({ }: { appRef: React.RefObject; }) { + if (!appRef.current?.page?.kind) return null; + switch (appRef.current?.page?.kind) { case "channel": return ; - - default: - return null; } } diff --git a/src/components/page/channel/ChannelPage.tsx b/src/components/page/channel/ChannelPage.tsx index 0287f87..f9b811b 100644 --- a/src/components/page/channel/ChannelPage.tsx +++ b/src/components/page/channel/ChannelPage.tsx @@ -1,16 +1,16 @@ import Enclave from "@/app/app"; import { ChannelPageProps } from "@/components/page/PageView"; +import TextChannel from "./TextChannel"; export default function ChannelPage({ appRef, }: { appRef: React.RefObject | null>; }) { + if (!appRef.current?.page?.channel.kind) return null; + switch (appRef.current?.page?.channel.kind) { case "text": - return ; - - default: - return null; + return ; } }