Explorar o código

render FixPageGrantAlert conditionally

yohei0125 %!s(int64=4) %!d(string=hai) anos
pai
achega
fef7f20304
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      packages/app/src/client/app.jsx

+ 6 - 2
packages/app/src/client/app.jsx

@@ -98,8 +98,6 @@ Object.assign(componentMappings, {
 
   'trash-page-alert': <TrashPageAlert />,
 
-  'fix-page-grant-alert': <FixPageGrantAlert />,
-
   'trash-page-list-container': <TrashPageList />,
 
   'not-found-page': <NotFoundPage />,
@@ -133,6 +131,12 @@ if (pageContainer.state.pageId != null) {
     'recent-created-icon': <RecentlyCreatedIcon />,
   });
 
+  if (!pageContainer.state.isEmpty) {
+    Object.assign(componentMappings, {
+      'fix-page-grant-alert': <FixPageGrantAlert />,
+    });
+  }
+
   // show the Page accessory modal when query of "compare" is requested
   if (revisionComparerContainer.getRevisionIDsToCompareAsParam().length > 0) {
     toastError('Sorry, opening PageAccessoriesModal is not implemented yet in v5.');