|
|
@@ -50,6 +50,8 @@ import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
|
|
import { captureException } from '@/infrastructure/error-reporter'
|
|
|
import OError from '@overleaf/o-error'
|
|
|
import getMeta from '@/utils/meta'
|
|
|
+import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
|
|
+import { useRailContext } from '@/features/ide-redesign/contexts/rail-context'
|
|
|
|
|
|
type PdfFile = Record<string, any>
|
|
|
|
|
|
@@ -125,6 +127,8 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
|
|
|
const { openDocWithId, openDocs, currentDocument } = useEditorManagerContext()
|
|
|
const { role } = useDetachContext()
|
|
|
|
|
|
+ const newEditor = useIsNewEditorEnabled()
|
|
|
+
|
|
|
const {
|
|
|
_id: projectId,
|
|
|
rootDocId,
|
|
|
@@ -135,6 +139,8 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
|
|
|
|
|
|
const { pdfPreviewOpen } = useLayoutContext()
|
|
|
|
|
|
+ const { openTab: openRailTab } = useRailContext()
|
|
|
+
|
|
|
const { features, alphaProgram, labsProgram } = useUserContext()
|
|
|
|
|
|
const { fileTreeData } = useFileTreeData()
|
|
|
@@ -742,8 +748,12 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
|
|
|
const lastCompileOptions = useMemo(() => data?.options || {}, [data])
|
|
|
|
|
|
useEffect(() => {
|
|
|
- const listener = (event: Event) => {
|
|
|
- setShowLogs((event as CustomEvent<boolean>).detail as boolean)
|
|
|
+ const listener = () => {
|
|
|
+ if (newEditor) {
|
|
|
+ openRailTab('errors')
|
|
|
+ } else {
|
|
|
+ setShowLogs(true)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
window.addEventListener('editor:show-logs', listener)
|
|
|
@@ -751,7 +761,7 @@ export const LocalCompileProvider: FC<React.PropsWithChildren> = ({
|
|
|
return () => {
|
|
|
window.removeEventListener('editor:show-logs', listener)
|
|
|
}
|
|
|
- }, [])
|
|
|
+ }, [newEditor, openRailTab])
|
|
|
|
|
|
const value = useMemo(
|
|
|
() => ({
|