mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #5986 from overleaf/jel-detach-stop-compile
Stop compile when detach layout selected GitOrigin-RevId: 27516373a5d4069c42596e422b564e0873564b63
This commit is contained in:
parent
0e20c204a1
commit
45e2c67264
1 changed files with 5 additions and 1 deletions
|
@ -7,6 +7,7 @@ import IconChecked from '../../../shared/components/icon-checked'
|
|||
import ControlledDropdown from '../../../shared/components/controlled-dropdown'
|
||||
import IconEditorOnly from './icon-editor-only'
|
||||
import IconPdfOnly from './icon-pdf-only'
|
||||
import { useCompileContext } from '../../../shared/context/compile-context'
|
||||
import { useLayoutContext } from '../../../shared/context/layout-context'
|
||||
import * as eventTracking from '../../../infrastructure/event-tracking'
|
||||
|
||||
|
@ -54,10 +55,13 @@ function LayoutDropdownButton() {
|
|||
pdfLayout,
|
||||
} = useLayoutContext(layoutContextPropTypes)
|
||||
|
||||
const { stopCompile } = useCompileContext()
|
||||
|
||||
const handleDetach = useCallback(() => {
|
||||
detach()
|
||||
stopCompile()
|
||||
eventTracking.sendMB('project-layout-detach')
|
||||
}, [detach])
|
||||
}, [detach, stopCompile])
|
||||
|
||||
const handleReattach = useCallback(() => {
|
||||
if (detachRole !== 'detacher') {
|
||||
|
|
Loading…
Reference in a new issue