mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
🐛 Fix not found page not rendering properly (#1308)
This commit is contained in:
parent
d40d4b27e2
commit
2ab67d819c
3 changed files with 3 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import { useParams, useSearchParams } from "next/navigation";
|
||||
import { notFound, useParams, useSearchParams } from "next/navigation";
|
||||
import React from "react";
|
||||
|
||||
import { LegacyPollContextProvider } from "@/components/poll/poll-context-provider";
|
||||
|
@ -35,7 +35,7 @@ const Prefetch = ({ children }: React.PropsWithChildren) => {
|
|||
const comments = trpc.polls.comments.list.useQuery({ pollId: urlId });
|
||||
|
||||
if (error?.data?.code === "NOT_FOUND") {
|
||||
return <div>Not found</div>;
|
||||
notFound();
|
||||
}
|
||||
if (!poll || !participants || !comments.isFetched) {
|
||||
return <Loader />;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { prisma } from "@rallly/database";
|
||||
import { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { InvitePage } from "@/app/[locale]/invite/[urlId]/invite-page";
|
||||
import { getTranslation } from "@/app/i18n";
|
||||
|
@ -36,7 +35,7 @@ export async function generateMetadata({
|
|||
const { t } = await getTranslation(locale);
|
||||
|
||||
if (!poll) {
|
||||
return notFound();
|
||||
return null;
|
||||
}
|
||||
|
||||
const { title, id, user } = poll;
|
||||
|
|
Loading…
Add table
Reference in a new issue