From cd206bcc68eb7ec0bb30ea3fb91c6afc82ee87f4 Mon Sep 17 00:00:00 2001 From: Greg Rickaby Date: Tue, 13 Feb 2024 09:56:44 -0600 Subject: [PATCH] if there's no media, display a message --- app/r/[slug]/page.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/r/[slug]/page.tsx b/app/r/[slug]/page.tsx index 3eb4369..fcf8bdc 100644 --- a/app/r/[slug]/page.tsx +++ b/app/r/[slug]/page.tsx @@ -51,6 +51,16 @@ export default async function Page(props: PageProps) { ) } + // No media? Bail. + if (!posts.data.children.length) { + return ( +
+

No media found

+

Try a different subreddit.

+
+ ) + } + return (