mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 13:10:56 +00:00
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:
parent
6cac373446
commit
3c8a9d9863
3 changed files with 7 additions and 3 deletions
|
@ -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 />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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: () => {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue