Skip to content

Commit

Permalink
fix(OO): Hide tooltip on Edit button
Browse files Browse the repository at this point in the history
Being in the public view, queries are not allowed,
so the tooltip cannot save its hidden state when
the user chooses it.
  • Loading branch information
Merkur39 committed Feb 3, 2025
1 parent 6c81502 commit 21f177b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/views/OnlyOffice/Toolbar/EditButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const EditButton = ({ openTooltip }) => {
)
}

const EditButtonWrapper = () => {
const EditButtonWithQuery = () => {
const { isEditorModeView } = useOnlyOfficeContext()

const { data: settings, ...appSettingsQueryResult } = useQuery(
Expand All @@ -122,4 +122,14 @@ const EditButtonWrapper = () => {
return <EditButton openTooltip={openTooltip} />
}

const EditButtonWrapper = () => {
const { isPublic } = useOnlyOfficeContext()

if (isPublic) {
return <EditButtonWithQuery />
}

return <EditButton openTooltip={false} />
}

export default EditButtonWrapper

0 comments on commit 21f177b

Please sign in to comment.