Browse Source

BugFix rendering React Components

Yuki Takei 9 years ago
parent
commit
2ed854f3c7
1 changed files with 4 additions and 2 deletions
  1. 4 2
      resource/js/app.js

+ 4 - 2
resource/js/app.js

@@ -47,9 +47,11 @@ const componentMappings = {
   //'revision-history': <PageHistory pageId={pageId} />,
   //'revision-history': <PageHistory pageId={pageId} />,
   //'page-comment': <PageComment />,
   //'page-comment': <PageComment />,
   'seen-user-list': <SeenUserList />,
   'seen-user-list': <SeenUserList />,
-  'revision-path': <RevisionPath pagePath={pagePath} />,
-  'revision-url': <RevisionUrl pagePath={pagePath} url={location.href} />,
 };
 };
+if (pagePath) {
+  componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} />;
+  componentMappings['revision-url'] = <RevisionUrl pagePath={pagePath} url={location.href} />;
+}
 
 
 Object.keys(componentMappings).forEach((key) => {
 Object.keys(componentMappings).forEach((key) => {
   const elem = document.getElementById(key);
   const elem = document.getElementById(key);