Răsfoiți Sursa

refactor method condition

Yuken Tezuka 3 ani în urmă
părinte
comite
7277eacaf3
1 a modificat fișierele cu 5 adăugiri și 5 ștergeri
  1. 5 5
      packages/app/src/pages/[[...path]].page.tsx

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

@@ -467,12 +467,12 @@ async function injectPageData(context: GetServerSidePropsContext, props: Props):
     if (templateData != null) {
       props.templateTagData = templateData.templateTags as string[];
       props.templateBodyData = templateData.templateBody as string;
+    }
 
-      // take over pagrent page grant
-      const ancestor = await Page.findAncestorByPathAndViewer(currentPathname, user);
-      if (ancestor != null) {
-        await applyGrantToPage(props, ancestor);
-      }
+    // apply pagrent page grant
+    const ancestor = await Page.findAncestorByPathAndViewer(currentPathname, user);
+    if (ancestor != null) {
+      await applyGrantToPage(props, ancestor);
     }
   }