From 64d431b873cc2d25756bec3dd32f2b3d81d7182d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Fri, 19 Apr 2024 20:35:57 +0200 Subject: [PATCH] Fix changing URL hash on `/new` (#19640) * Fix changing URL hash on `/new` * Properly load search param overwrites * Reset proj ID --- .../dashboard/src/workspaces/CreateWorkspacePage.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/dashboard/src/workspaces/CreateWorkspacePage.tsx b/components/dashboard/src/workspaces/CreateWorkspacePage.tsx index d91cb387f5fc05..2931763469496c 100644 --- a/components/dashboard/src/workspaces/CreateWorkspacePage.tsx +++ b/components/dashboard/src/workspaces/CreateWorkspacePage.tsx @@ -110,6 +110,13 @@ export function CreateWorkspacePage() { const workspaceContext = useWorkspaceContext(contextURL); const needsGitAuthorization = useNeedsGitAuthorization(); + useEffect(() => { + setAutostart(false); + setContextURL(StartWorkspaceOptions.parseContextUrl(location.hash)); + setSelectedProjectID(undefined); + setNextLoadOption("searchParams"); + }, [location.hash]); + const storeAutoStartOptions = useCallback(async () => { if (!workspaceContext.data || !user || !currentOrg) { return;