diff --git a/.env.sample b/.env.sample index 9d92216ba..dfd6688df 100644 --- a/.env.sample +++ b/.env.sample @@ -10,11 +10,11 @@ UTILS_SECRET=generate_a_new_key # For production point these at your databases, in development the default # should work out of the box. -DATABASE_URL=postgres://user:pass@localhost:5532/outline -DATABASE_URL_TEST=postgres://user:pass@localhost:5532/outline-test +DATABASE_URL=postgres://user:pass@localhost:5432/outline +DATABASE_URL_TEST=postgres://user:pass@localhost:5432/outline-test # Uncomment this to disable SSL for connecting to Postgres # PGSSLMODE=disable -REDIS_URL=redis://localhost:6479 +REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx index 83ab850f9..881db17ec 100644 --- a/app/scenes/Document/components/Document.tsx +++ b/app/scenes/Document/components/Document.tsx @@ -416,8 +416,10 @@ class DocumentScene extends React.Component { this.editor.current.getHeadings() : []; + const hasHeadings = headings.length > 0; const showContents = - ui.tocVisible && (readOnly || team?.collaborativeEditing); + ui.tocVisible && + ((readOnly && hasHeadings) || team?.collaborativeEditing); const collaborativeEditing = team?.collaborativeEditing && !document.isArchived && @@ -509,6 +511,7 @@ class DocumentScene extends React.Component { )}
- {toc} + {documentHasHeadings ? toc : null} ) }