File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
web-marketplace/src/legacy-pages/ProjectCreate/hooks Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1- import { useNavigate } from 'react-router-dom' ;
2-
31import { useCreateProjectContext } from '../ProjectCreate' ;
2+ import { useRouter } from 'next/navigation' ;
43
54export const useProjectSaveAndExit = ( ) => {
65 const { formRef, shouldNavigateRef, isOrganizationAccount } =
76 useCreateProjectContext ( ) ;
8- const navigate = useNavigate ( ) ;
7+ const router = useRouter ( ) ;
98
109 const saveAndExit = async ( ) : Promise < void > => {
1110 if ( shouldNavigateRef ) {
1211 shouldNavigateRef . current = false ;
1312 await formRef ?. current ?. submitForm ( true ) ;
14- shouldNavigateRef . current = true ;
1513 }
16- if ( isOrganizationAccount ) navigate ( '/dashboard/organization/projects' ) ;
17- else navigate ( '/dashboard/projects' ) ;
14+ if ( isOrganizationAccount ) router . push ( '/dashboard/organization/projects' ) ;
15+ else router . push ( '/dashboard/projects' ) ;
1816 } ;
1917
2018 return saveAndExit ;
You can’t perform that action at this time.
0 commit comments