mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Merge pull request #36000 from overleaf/ds-offline-mode-disable-buttons-detached-mode
[WEB] Read network stall state from compile context instead of hook directly for log error buttons in offline mode GitOrigin-RevId: ca898f17960784690a27cea3f234568e4532c870
This commit is contained in:
@@ -21,7 +21,7 @@ import importOverleafModules from '../../../../macros/import-overleaf-module.mac
|
|||||||
import MaterialIcon from '@/shared/components/material-icon'
|
import MaterialIcon from '@/shared/components/material-icon'
|
||||||
import { useFileTreePathContext } from '@/features/file-tree/contexts/file-tree-path'
|
import { useFileTreePathContext } from '@/features/file-tree/contexts/file-tree-path'
|
||||||
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
|
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
|
||||||
import useIsNetworkStalled from '@/features/ide-react/hooks/use-is-network-stalled'
|
import { useDetachCompileContext as useCompileContext } from '@/shared/context/detach-compile-context'
|
||||||
|
|
||||||
const actionComponents = importOverleafModules(
|
const actionComponents = importOverleafModules(
|
||||||
'pdfLogEntryHeaderActionComponents'
|
'pdfLogEntryHeaderActionComponents'
|
||||||
@@ -62,7 +62,7 @@ function LogEntryHeader({
|
|||||||
const [locationSpanOverflown, setLocationSpanOverflown] = useState(false)
|
const [locationSpanOverflown, setLocationSpanOverflown] = useState(false)
|
||||||
const { findEntityByPath } = useFileTreePathContext()
|
const { findEntityByPath } = useFileTreePathContext()
|
||||||
const { openEntity } = useFileTreeOpenContext()
|
const { openEntity } = useFileTreeOpenContext()
|
||||||
const isDisabledDueToNetworkStall = useIsNetworkStalled()
|
const { isNetworkStalled } = useCompileContext()
|
||||||
|
|
||||||
useResizeObserver(
|
useResizeObserver(
|
||||||
logLocationSpanRef,
|
logLocationSpanRef,
|
||||||
@@ -172,7 +172,7 @@ function LogEntryHeader({
|
|||||||
description={t('go_to_code_location')}
|
description={t('go_to_code_location')}
|
||||||
overlayProps={{ placement: 'bottom' }}
|
overlayProps={{ placement: 'bottom' }}
|
||||||
>
|
>
|
||||||
{isDisabledDueToNetworkStall ? (
|
{isNetworkStalled ? (
|
||||||
<span className="d-inline-block">
|
<span className="d-inline-block">
|
||||||
<OLIconButton
|
<OLIconButton
|
||||||
onClick={onSourceLocationClick}
|
onClick={onSourceLocationClick}
|
||||||
|
|||||||
Reference in New Issue
Block a user