From 73b189560f93692f2d281e74cf4d4e01022d5e49 Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Thu, 16 May 2024 10:51:35 +0500 Subject: [PATCH] fix: handle navigation after create --- src/pages/create/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index c308026..64e40bd 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -20,10 +20,10 @@ import { } from '@mui/material' import { MuiFileInput } from 'mui-file-input' import { useEffect, useState } from 'react' -import { Link } from 'react-router-dom' +import { Link, useNavigate } from 'react-router-dom' import { LoadingSpinner } from '../../components/LoadingSpinner' import { MetadataController, NostrController } from '../../controllers' -import { getProfileRoute } from '../../routes' +import { appPrivateRoutes, getProfileRoute } from '../../routes' import { ProfileMetadata, User, UserRole } from '../../types' import { encryptArrayBuffer, @@ -45,6 +45,7 @@ import { useSelector } from 'react-redux' import { State } from '../../store/rootReducer' export const CreatePage = () => { + const navigate = useNavigate() const [isLoading, setIsLoading] = useState(false) const [loadingSpinnerDesc, setLoadingSpinnerDesc] = useState('') @@ -349,7 +350,7 @@ export const CreatePage = () => { } setIsLoading(false) - // todo: navigate to verify + navigate(`${appPrivateRoutes.sign}?file=${fileUrl}&key=${encryptionKey}`) } if (authUrl) {