fix: remove redundant variable

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-02 19:45:20 +02:00
parent 3b2054532c
commit db6276e019

View file

@ -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)