diff --git a/src/app/app.ts b/src/app/app.ts
index c1f3a8b..e8a298b 100644
--- a/src/app/app.ts
+++ b/src/app/app.ts
@@ -263,7 +263,8 @@ export default class Enclave
{
const page = this.page as Page | undefined;
- const isInvisibleChannel = page?.channel.id !== channelId;
+ const isInvisibleChannel =
+ page?.kind === "channel" && page?.channel.id !== channelId;
return messages.map((message) => {
if (
diff --git a/src/components/page/MainPage.tsx b/src/components/page/MainPage.tsx
new file mode 100644
index 0000000..a896d07
--- /dev/null
+++ b/src/components/page/MainPage.tsx
@@ -0,0 +1,7 @@
+import Enclave from "@/app/app";
+
+export default function MainPage({
+ appRef,
+}: {
+ appRef: React.RefObject;
+}) {}
diff --git a/src/components/page/PageView.tsx b/src/components/page/PageView.tsx
index 7ba5401..1969aa6 100644
--- a/src/components/page/PageView.tsx
+++ b/src/components/page/PageView.tsx
@@ -1,6 +1,7 @@
import Enclave from "@/app/app";
import ChannelPage from "./channel/ChannelPage";
import { Channel } from "@/lib/types";
+import MainPage from "./MainPage";
export type ChannelPageProps = {
kind: "channel";
@@ -14,10 +15,14 @@ export default function Page({
}: {
appRef: React.RefObject;
}) {
- if (!appRef.current?.page?.kind) return null;
+ if (!appRef.current?.page?.kind) return ;
switch (appRef.current?.page?.kind) {
case "channel":
- return ;
+ return (
+ | null>}
+ />
+ );
}
}
diff --git a/src/components/view/Sidebar.tsx b/src/components/view/Sidebar.tsx
index 5aed5af..47cdbdb 100644
--- a/src/components/view/Sidebar.tsx
+++ b/src/components/view/Sidebar.tsx
@@ -115,6 +115,11 @@ export function RenderChannels({
appRef: React.RefObject;
channels: Channel[];
}) {
+ const currentChannel =
+ appRef.current?.page?.kind === "channel"
+ ? appRef.current?.page?.channel
+ : undefined;
+
return channels.map((channel) =>
channel.kind === "category" ? (
@@ -123,7 +128,7 @@ export function RenderChannels({
{
if (!appRef.current) {