diff --git a/components/dashboard/src/projects/NewProject.tsx b/components/dashboard/src/projects/NewProject.tsx index 7a220396281f70..a6e236996ef4e2 100644 --- a/components/dashboard/src/projects/NewProject.tsx +++ b/components/dashboard/src/projects/NewProject.tsx @@ -59,6 +59,10 @@ export default function NewProject() { const team = teams?.find(t => t.slug === teamParam); setSelectedTeamOrUser(team); } + if (params.get("user")) { + window.history.replaceState({}, '', window.location.pathname); + setSelectedTeamOrUser(user); + } }, []); useEffect(() => { diff --git a/components/dashboard/src/projects/Projects.tsx b/components/dashboard/src/projects/Projects.tsx index eec0bf3e475fda..1adecacf2ea306 100644 --- a/components/dashboard/src/projects/Projects.tsx +++ b/components/dashboard/src/projects/Projects.tsx @@ -63,7 +63,7 @@ export default function () { setLastPrebuilds(map); } - const newProjectUrl = !!team ? `/new?team=${team.slug}` : '/new'; + const newProjectUrl = !!team ? `/new?team=${team.slug}` : '/new?user=1'; const onNewProject = () => { history.push(newProjectUrl); } diff --git a/components/dashboard/src/workspaces/Workspaces.tsx b/components/dashboard/src/workspaces/Workspaces.tsx index 482b3b519767eb..6e417ce9873303 100644 --- a/components/dashboard/src/workspaces/Workspaces.tsx +++ b/components/dashboard/src/workspaces/Workspaces.tsx @@ -45,7 +45,7 @@ export default function () { const [teamsWorkspaceModel, setTeamsWorkspaceModel] = useState(); const [teamsActiveWorkspaces, setTeamsActiveWorkspaces] = useState([]); - const newProjectUrl = !!team ? `/new?team=${team.slug}` : '/new'; + const newProjectUrl = !!team ? `/new?team=${team.slug}` : '/new?user=1'; const onNewProject = () => { history.push(newProjectUrl); }