Skip to content

Commit fd6981e

Browse files
authored
fix: fix flashing error dialog in the create workspace page (#18180)
This PR which updated react-query to 5.77.0 introduced an issue on the create workspace page where the error dialog would be briefly displayed while the page is loading. #18039 The issue is that there is a moment when `optOutQuery.isLoading` is false and `optOutQuery.data` is undefined causing the ErrorAlert to display.
1 parent 1d27d4f commit fd6981e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ const CreateWorkspaceExperimentRouter: FC = () => {
4444
});
4545

4646
if (dynamicParametersEnabled) {
47-
if (optOutQuery.isLoading) {
48-
return <Loader />;
47+
if (optOutQuery.isError) {
48+
return <ErrorAlert error={optOutQuery.error} />;
4949
}
5050
if (!optOutQuery.data) {
51-
return <ErrorAlert error={optOutQuery.error} />;
51+
return <Loader />;
5252
}
5353

5454
const toggleOptedOut = () => {

0 commit comments

Comments
 (0)