mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:53:40 -05:00
Merge pull request #5275 from overleaf/jpa-hide-refresh-linked-file-for-read-only
[web] hide refresh linked file button for readOnly users GitOrigin-RevId: 02ae9805259181d66c69301e7b0a0b5fe3cdf7a0
This commit is contained in:
parent
2a935d7ab5
commit
4b0e85f340
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
|||
import Icon from '../../../shared/components/icon'
|
||||
import { formatTime, relativeDate } from '../../utils/format-date'
|
||||
import { postJSON } from '../../../infrastructure/fetch-json'
|
||||
import { useEditorContext } from '../../../shared/context/editor-context'
|
||||
import { useProjectContext } from '../../../shared/context/project-context'
|
||||
|
||||
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
|
||||
|
@ -35,6 +36,9 @@ export default function FileViewHeader({ file, storeReferencesKeys }) {
|
|||
const { _id: projectId } = useProjectContext({
|
||||
_id: PropTypes.string.isRequired,
|
||||
})
|
||||
const { permissionsLevel } = useEditorContext({
|
||||
permissionsLevel: PropTypes.string.isRequired,
|
||||
})
|
||||
const { t } = useTranslation()
|
||||
|
||||
const [refreshing, setRefreshing] = useState(false)
|
||||
|
@ -110,7 +114,7 @@ export default function FileViewHeader({ file, storeReferencesKeys }) {
|
|||
tprLinkedFileInfo.map(({ import: { LinkedFileInfo }, path }) => (
|
||||
<LinkedFileInfo key={path} file={file} />
|
||||
))}
|
||||
{file.linkedFileData && (
|
||||
{file.linkedFileData && permissionsLevel !== 'readOnly' && (
|
||||
<button
|
||||
className="btn btn-success"
|
||||
onClick={refreshFile}
|
||||
|
|
Loading…
Reference in a new issue