Merge pull request #8853 from overleaf/jpa-no-pdf-download-in-editor-only-mode

[web] do not download the pdf in editor only view mode

GitOrigin-RevId: 4d8936964540c0820f72abb8c858e86e2e7196e2
This commit is contained in:
Jakob Ackermann 2022-07-18 11:24:14 +01:00 committed by Copybot
parent 6cac373446
commit 3c8a9d9863
3 changed files with 7 additions and 3 deletions

View file

@ -3,9 +3,13 @@ import useCompileTriggers from '../hooks/use-compile-triggers'
import { memo } from 'react' import { memo } from 'react'
import withErrorBoundary from '../../../infrastructure/error-boundary' import withErrorBoundary from '../../../infrastructure/error-boundary'
import ErrorBoundaryFallback from './error-boundary-fallback' import ErrorBoundaryFallback from './error-boundary-fallback'
import { useLayoutContext } from '../../../shared/context/layout-context'
function PdfPreview() { function PdfPreview() {
useCompileTriggers() useCompileTriggers()
const { detachRole } = useLayoutContext()
if (detachRole === 'detacher') return null
return <PdfPreviewPane /> return <PdfPreviewPane />
} }

View file

@ -19,8 +19,8 @@ describe('<ToolbarHeader />', function () {
hasPublishPermissions: true, hasPublishPermissions: true,
trackChangesVisible: true, trackChangesVisible: true,
handleChangeLayout: () => {}, handleChangeLayout: () => {},
pdfLayout: '', pdfLayout: 'sideBySide',
view: '', view: 'editor',
reattach: () => {}, reattach: () => {},
detach: () => {}, detach: () => {},
} }

View file

@ -45,7 +45,7 @@ export function EditorProviders({
fileRefs: [], fileRefs: [],
}, },
], ],
ui = { view: null, pdfLayout: 'flat', chatOpen: true }, ui = { view: 'editor', pdfLayout: 'sideBySide', chatOpen: true },
fileTreeManager = { fileTreeManager = {
findEntityById: () => null, findEntityById: () => null,
findEntityByPath: () => null, findEntityByPath: () => null,