diff --git a/frontend/src/components/document-read-only-page/document-infobar.tsx b/frontend/src/components/document-read-only-page/document-infobar.tsx index d3822e5ad..aa49c4fe0 100644 --- a/frontend/src/components/document-read-only-page/document-infobar.tsx +++ b/frontend/src/components/document-read-only-page/document-infobar.tsx @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { useApplicationState } from '../../hooks/common/use-application-state' +import { useNoteDetails } from '../../hooks/common/use-note-details' import { InternalLink } from '../common/links/internal-link' import { ShowIf } from '../common/show-if/show-if' import { NoteInfoLineCreated } from '../editor-page/document-bar/note-info/note-info-line-created' @@ -18,7 +18,7 @@ import { Trans, useTranslation } from 'react-i18next' */ export const DocumentInfobar: React.FC = () => { const { t } = useTranslation() - const noteDetails = useApplicationState((state) => state.noteDetails) + const noteDetails = useNoteDetails() // TODO Check permissions ("writability") of note and show edit link depending on that. return ( diff --git a/frontend/src/components/editor-page/app-bar/app-bar.tsx b/frontend/src/components/editor-page/app-bar/app-bar.tsx index 40d45073c..eb6d8339c 100644 --- a/frontend/src/components/editor-page/app-bar/app-bar.tsx +++ b/frontend/src/components/editor-page/app-bar/app-bar.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ import { useApplicationState } from '../../../hooks/common/use-application-state' +import { useNoteDetails } from '../../../hooks/common/use-note-details' import { NewNoteButton } from '../../common/new-note-button/new-note-button' import { ShowIf } from '../../common/show-if/show-if' import { SignInButton } from '../../landing-layout/navigation/sign-in-button' @@ -34,17 +35,17 @@ export interface AppBarProps { */ export const AppBar: React.FC = ({ mode }) => { const userExists = useApplicationState((state) => !!state.user) - const noteFrontmatter = useApplicationState((state) => state.noteDetails.frontmatter) + const noteFrontmatter = useNoteDetails() return (