mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #35941 from overleaf/ds-suggest-fix-disable-offline-mode
[WEB] Disabling buttons in error logs in offline mode GitOrigin-RevId: b19daaf1cf98ecf626568690ff677a491b8dad63
This commit is contained in:
@@ -21,6 +21,7 @@ import importOverleafModules from '../../../../macros/import-overleaf-module.mac
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
import { useFileTreePathContext } from '@/features/file-tree/contexts/file-tree-path'
|
||||
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
|
||||
import useIsNetworkStalled from '@/features/ide-react/hooks/use-is-network-stalled'
|
||||
|
||||
const actionComponents = importOverleafModules(
|
||||
'pdfLogEntryHeaderActionComponents'
|
||||
@@ -61,6 +62,7 @@ function LogEntryHeader({
|
||||
const [locationSpanOverflown, setLocationSpanOverflown] = useState(false)
|
||||
const { findEntityByPath } = useFileTreePathContext()
|
||||
const { openEntity } = useFileTreeOpenContext()
|
||||
const isDisabledDueToNetworkStall = useIsNetworkStalled()
|
||||
|
||||
useResizeObserver(
|
||||
logLocationSpanRef,
|
||||
@@ -170,12 +172,24 @@ function LogEntryHeader({
|
||||
description={t('go_to_code_location')}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<OLIconButton
|
||||
onClick={onSourceLocationClick}
|
||||
variant="ghost"
|
||||
icon="my_location"
|
||||
accessibilityLabel={t('go_to_code_location')}
|
||||
/>
|
||||
{isDisabledDueToNetworkStall ? (
|
||||
<span className="d-inline-block">
|
||||
<OLIconButton
|
||||
onClick={onSourceLocationClick}
|
||||
variant="ghost"
|
||||
icon="my_location"
|
||||
accessibilityLabel={t('go_to_code_location')}
|
||||
disabled
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
<OLIconButton
|
||||
onClick={onSourceLocationClick}
|
||||
variant="ghost"
|
||||
icon="my_location"
|
||||
accessibilityLabel={t('go_to_code_location')}
|
||||
/>
|
||||
)}
|
||||
</OLTooltip>
|
||||
)}
|
||||
{actionComponents.map(({ import: { default: Component }, path }) => (
|
||||
|
||||
Reference in New Issue
Block a user