Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
fix: add suspense to server components
Browse files Browse the repository at this point in the history
  • Loading branch information
Firgrep committed Jul 21, 2024
1 parent e190253 commit 36a542f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/(user)/billing/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { dbGetUserPurchasedCourses } from "@/server/controllers/dbController";
import Image from "next/image";
import Link from "next/link";
import { redirect } from "next/navigation";
import { Suspense } from "react";

export const dynamic = "force-dynamic";

Expand All @@ -20,7 +21,9 @@ export default async function Billing() {

return (
<PageWrapper>
<Maintenance area="user" />
<Suspense>
<Maintenance area="user" />
</Suspense>
<div className="py-10">
<h1 className="text-xl font-bold py-6 text-center">Billing</h1>
{purchasedCourses && purchasedCourses.length > 0 ? (
Expand Down
5 changes: 4 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import InfoCard from "@/components/InfoCard";
import { PolyRhythmicSpiral } from "@/components/animations/PolyRhythmicSpiral";
import Link from "next/link";
import { Maintenance } from "@/components/Maintenance";
import { Suspense } from "react";

export default async function Home() {
return (
<>
<Hero />
<PageWrapper>
<OpeningDescription />
<Maintenance area="global" />
<Suspense>
<Maintenance area="global" />
</Suspense>
<MainInfoCard />
<InfoCards />
<Community />
Expand Down

0 comments on commit 36a542f

Please sign in to comment.