nullable note details

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-03-26 10:27:57 +02:00
parent 4fbe813af0
commit a05b387ee1
No known key found for this signature in database
GPG key ID: 42498463316F048B
58 changed files with 194 additions and 125 deletions

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { deleteNote } from '../../../../api/notes'
import { useApplicationState } from '../../../../hooks/common/use-application-state'
import { useBooleanState } from '../../../../hooks/common/use-boolean-state'
import { useNoteDetails } from '../../../../hooks/common/use-note-details'
import { cypressId } from '../../../../utils/cypress-attribute'
import { Logger } from '../../../../utils/logger'
import { useUiNotifications } from '../../../notifications/ui-notification-boundary'
@ -29,7 +29,7 @@ const logger = new Logger('note-deletion')
export const DeleteNoteSidebarEntry: React.FC<PropsWithChildren<SpecificSidebarEntryProps>> = ({ hide, className }) => {
useTranslation()
const router = useRouter()
const noteId = useApplicationState((state) => state.noteDetails.id)
const noteId = useNoteDetails().id
const [modalVisibility, showModal, closeModal] = useBooleanState()
const { showErrorNotification } = useUiNotifications()