itizawa 5 лет назад
Родитель
Сommit
a6aa1741ab
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      src/client/js/components/Sidebar/SidebarNav.jsx

+ 7 - 2
src/client/js/components/Sidebar/SidebarNav.jsx

@@ -75,10 +75,15 @@ class SidebarNav extends React.Component {
     ];
     ];
 
 
     const secondaryItems = [
     const secondaryItems = [
-      this.generateSecondaryItemObj('draft', 'Draft', 'file_copy', `/user/${currentUsername}#user-draft-list`),
       this.generateSecondaryItemObj('help', 'Help', 'help', 'https://docs.growi.org', true),
       this.generateSecondaryItemObj('help', 'Help', 'help', 'https://docs.growi.org', true),
-      this.generateSecondaryItemObj('trash', 'Trash', 'delete', '/trash'),
     ];
     ];
+
+    if (currentUsername != null) {
+      secondaryItems.unshift( // add to the beginning
+        this.generateSecondaryItemObj('draft', 'Draft', 'file_copy', `/user/${currentUsername}#user-draft-list`),
+        this.generateSecondaryItemObj('trash', 'Trash', 'delete', '/trash'),
+      );
+    }
     if (isAdmin) {
     if (isAdmin) {
       secondaryItems.unshift( // add to the beginning
       secondaryItems.unshift( // add to the beginning
         this.generateSecondaryItemObj('admin', 'Admin', 'settings', '/admin'),
         this.generateSecondaryItemObj('admin', 'Admin', 'settings', '/admin'),