fix(cloud): default to active workspace on upgrade path

This commit is contained in:
Henry
2026-07-29 12:48:56 +01:00
parent fee82e5e73
commit 5b586f4871

View File

@@ -48,7 +48,11 @@ export default function SelectPlanView() {
(searchParams.get("billing") as Billing | null) ?? "annual", (searchParams.get("billing") as Billing | null) ?? "annual",
); );
const returnUrl = searchParams.get("returnUrl") ?? "/boards"; const returnUrl = searchParams.get("returnUrl") ?? "/boards";
const workspacePublicId = searchParams.get("workspacePublicId"); const workspacePublicId =
searchParams.get("workspacePublicId") ??
(typeof window !== "undefined"
? localStorage.getItem("workspacePublicId")
: null);
const { data: workspaces } = api.workspace.all.useQuery(); const { data: workspaces } = api.workspace.all.useQuery();
const { data: session } = authClient.useSession(); const { data: session } = authClient.useSession();
const { data: user } = api.user.getUser.useQuery(undefined, { const { data: user } = api.user.getUser.useQuery(undefined, {