Explorar o código

refactor method condition

Yuken Tezuka %!s(int64=3) %!d(string=hai) anos
pai
achega
7277eacaf3
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  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);
     }
   }