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:
Davinder Singh
2026-09-17 11:43:24 +00:00
committed by Copybot
parent 36d0a5c227
commit ffeb3ef5de
@@ -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}