Skip to content

Commit defd070

Browse files
committed
change to blocking
1 parent 7d36ff8 commit defd070

1 file changed

Lines changed: 2 additions & 24 deletions

File tree

‎frontend/main/src/pages/schedule/[slug].tsx‎

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import {
22
getSite,
3-
queryPurrfectStreamBySlug,
43
queryPurrfectStreamByScheduled,
54
} from '@/services/notion.server';
65
import { NextSeo } from 'next-seo';
76
import Layout from '@/layout/Layout';
87
import { Site } from '@/models/site.model';
9-
import { Post, PostType } from '@/models/post.model';
8+
import { Post } from '@/models/post.model';
109
import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next';
1110
import ScheduleUpper from '@/components/ScheduleUpper';
1211
import ScheduleCard from '@/components/ScheduleCard';
13-
import DefaultErrorPage from 'next/error';
14-
import AJLoading from '@/components/global/icons/AJLoading';
15-
import { useRouter } from 'next/router';
1612

1713
interface StaticParams {
1814
site: Site;
@@ -33,7 +29,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
3329
}
3430
return {
3531
paths,
36-
fallback: true,
32+
fallback: 'blocking',
3733
};
3834
};
3935

@@ -72,24 +68,6 @@ export default function SchedulePage({
7268
site,
7369
post,
7470
}: InferGetStaticPropsType<typeof getStaticProps>) {
75-
const router = useRouter();
76-
if (router.isFallback) {
77-
return (
78-
<Layout site={site}>
79-
<section className="max-w-md p-10 mx-auto">
80-
<h1>Loading...</h1>
81-
<AJLoading className="w-full h-auto" />
82-
</section>
83-
</Layout>
84-
);
85-
}
86-
if (!post) {
87-
return (
88-
<Layout site={site}>
89-
<DefaultErrorPage statusCode={404} />
90-
</Layout>
91-
);
92-
}
9371
let re = /(\w+).null - /;
9472
const title = post?.title?.replace(re, '');
9573
return (

0 commit comments

Comments
 (0)