Fix recursion
This commit is contained in:
@@ -14,11 +14,10 @@ export default function Page({
|
|||||||
}: {
|
}: {
|
||||||
appRef: React.RefObject<Enclave | null>;
|
appRef: React.RefObject<Enclave | null>;
|
||||||
}) {
|
}) {
|
||||||
|
if (!appRef.current?.page?.kind) return null;
|
||||||
|
|
||||||
switch (appRef.current?.page?.kind) {
|
switch (appRef.current?.page?.kind) {
|
||||||
case "channel":
|
case "channel":
|
||||||
return <ChannelPage appRef={appRef} />;
|
return <ChannelPage appRef={appRef} />;
|
||||||
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import Enclave from "@/app/app";
|
import Enclave from "@/app/app";
|
||||||
import { ChannelPageProps } from "@/components/page/PageView";
|
import { ChannelPageProps } from "@/components/page/PageView";
|
||||||
|
import TextChannel from "./TextChannel";
|
||||||
|
|
||||||
export default function ChannelPage({
|
export default function ChannelPage({
|
||||||
appRef,
|
appRef,
|
||||||
}: {
|
}: {
|
||||||
appRef: React.RefObject<Enclave<ChannelPageProps> | null>;
|
appRef: React.RefObject<Enclave<ChannelPageProps> | null>;
|
||||||
}) {
|
}) {
|
||||||
|
if (!appRef.current?.page?.channel.kind) return null;
|
||||||
|
|
||||||
switch (appRef.current?.page?.channel.kind) {
|
switch (appRef.current?.page?.channel.kind) {
|
||||||
case "text":
|
case "text":
|
||||||
return <ChannelPage appRef={appRef} />;
|
return <TextChannel appRef={appRef} />;
|
||||||
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user