From e155cb9923dbb12a653cb02b4c4b18f5f77fd05c Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 7 Aug 2024 09:31:50 +0200 Subject: [PATCH] fix: don't delete projects screen from history (#7787) Fixes a bug in the navigation when you create a project. It used to be that we'd replace the current entry in the browser history when we took you to a separate form for it. However, now that we instead use a dialog, we don't want to replace the history. Before: if you created a project and navigated back, you'd be taken to the page you were at BEFORE you went to the projects page, whether that was in Unleash or otherwise. Now you'll be taken back to the projects page. --- .../CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx index 49751e758634..3e45f6102a47 100644 --- a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx +++ b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx @@ -180,7 +180,7 @@ export const CreateProjectDialog = ({ try { const createdProject = await createProject(projectPayload); refetchUser(); - navigate(`/projects/${createdProject.id}`, { replace: true }); + navigate(`/projects/${createdProject.id}`); setToastData({ title: 'Project created', text: 'Now you can add flags to this project',