mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36: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 { cypressId } from '../../../utils/cypress-attribute'
|
||||||
import { useUiNotifications } from '../../notifications/ui-notification-boundary'
|
import { useUiNotifications } from '../../notifications/ui-notification-boundary'
|
||||||
import { IconButton } from '../icon-button/icon-button'
|
import { IconButton } from '../icon-button/icon-button'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/navigation'
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
import { FileEarmarkPlus as IconPlus } from 'react-bootstrap-icons'
|
import { FileEarmarkPlus as IconPlus } from 'react-bootstrap-icons'
|
||||||
import { Trans } from 'react-i18next'
|
import { Trans } from 'react-i18next'
|
||||||
|
@ -21,8 +21,7 @@ export const NewNoteButton: React.FC = () => {
|
||||||
const createNewNoteAndRedirect = useCallback((): void => {
|
const createNewNoteAndRedirect = useCallback((): void => {
|
||||||
createNote('')
|
createNote('')
|
||||||
.then((note) => {
|
.then((note) => {
|
||||||
const to = `/n/${note.metadata.primaryAddress}`
|
router?.push(`/n/${note.metadata.primaryAddress}`)
|
||||||
return router?.push(to)
|
|
||||||
})
|
})
|
||||||
.catch((error: Error) => {
|
.catch((error: Error) => {
|
||||||
showErrorNotification(error.message)
|
showErrorNotification(error.message)
|
||||||
|
|
Loading…
Reference in a new issue