8000 feat: check for classic flow on the create workspace page by jaaydenh · Pull Request #17852 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: check for classic flow on the create workspace page #17852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: check for classic flowremove localstorage set on queryFn
  • Loading branch information
jaaydenh committed May 16, 2025
commit 411925ad9906099a95547a021dddea7caaa3a538
Original file line number Diff l 8000 ine number Diff line change
Expand Up @@ -30,11 +30,26 @@ const CreateWorkspaceExperimentRouter: FC = () => {
templateQuery.data.id,
"optOut",
],
queryFn: () => ({
templateId: templateQuery.data.id,
optedOut:
localStorage.getItem(optOutKey(templateQuery.data.id)) === "true",
}),
queryFn: () => {
const templateId = templateQuery.data.id;
const localStorageKey = optOutKey(templateId);
const storedOptOutString = localStorage.getItem(localStorageKey);

let optOutResult: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use a ternary here?


if (storedOptOutString !== null) {
optOutResult = storedOptOutString === "true";
} else {
optOutResult = Boolean(
templateQuery.data.use_classic_parameter_flow,
);
}

return {
templateId: templateId,
optedOut: optOutResult,
};
},
}
: { enabled: false },
);
Expand Down
Loading
0