Yuki Takei 3 лет назад
Родитель
Сommit
bf54cff855
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      packages/app/src/pages/[[...path]].page.tsx

+ 4 - 4
packages/app/src/pages/[[...path]].page.tsx

@@ -259,13 +259,13 @@ async function injectRoutingInformation(context: GetServerSidePropsContext, prop
 
   const { currentPathname } = props;
   const pageId = getPageIdFromPathname(currentPathname);
-  const isParmalink = pageId != null;
+  const isPermalink = pageId != null;
 
   const page = pageWithMeta?.data;
 
   if (page == null) {
     // check the page is forbidden or just does not exist.
-    const count = isParmalink ? await Page.count({ _id: pageId }) : await Page.count({ path: currentPathname });
+    const count = isPermalink ? await Page.count({ _id: pageId }) : await Page.count({ path: currentPathname });
     props.isForbidden = count > 0;
     props.isNotFound = true;
     logger.warn(`Page is ${props.isForbidden ? 'forbidden' : 'not found'}`, currentPathname);
@@ -273,12 +273,12 @@ async function injectRoutingInformation(context: GetServerSidePropsContext, prop
 
   if (page != null) {
     // /62a88db47fed8b2d94f30000 ==> /path/to/page
-    if (isParmalink && page.isEmpty) {
+    if (isPermalink && page.isEmpty) {
       props.currentPathname = page.path;
     }
 
     // /path/to/page ==> /62a88db47fed8b2d94f30000
-    if (!isParmalink && !page.isEmpty) {
+    if (!isPermalink && !page.isEmpty) {
       const isToppage = pagePathUtils.isTopPage(props.currentPathname);
       if (!isToppage) {
         props.currentPathname = `/${page._id}`;