mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
fix: remove redundant variable
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
3b2054532c
commit
db6276e019
1 changed files with 2 additions and 3 deletions
|
@ -7,7 +7,7 @@ import { createNote } from '../../../api/notes'
|
|||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import { useUiNotifications } from '../../notifications/ui-notification-boundary'
|
||||
import { IconButton } from '../icon-button/icon-button'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import React, { useCallback } from 'react'
|
||||
import { FileEarmarkPlus as IconPlus } from 'react-bootstrap-icons'
|
||||
import { Trans } from 'react-i18next'
|
||||
|
@ -21,8 +21,7 @@ export const NewNoteButton: React.FC = () => {
|
|||
const createNewNoteAndRedirect = useCallback((): void => {
|
||||
createNote('')
|
||||
.then((note) => {
|
||||
const to = `/n/${note.metadata.primaryAddress}`
|
||||
return router?.push(to)
|
||||
router?.push(`/n/${note.metadata.primaryAddress}`)
|
||||
})
|
||||
.catch((error: Error) => {
|
||||
showErrorNotification(error.message)
|
||||
|
|
Loading…
Reference in a new issue