From fd6981e5147f05daa27ebc85cbccf6a9fdd24c42 Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Mon, 2 Jun 2025 15:55:05 -0500 Subject: [PATCH] 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. https://github.com/coder/coder/pull/18039 The issue is that there is a moment when `optOutQuery.isLoading` is false and `optOutQuery.data` is undefined causing the ErrorAlert to display. --- .../CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx index 90de67fb11..4f2d0a4e4f 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspaceExperimentRouter.tsx @@ -44,11 +44,11 @@ const CreateWorkspaceExperimentRouter: FC = () => { }); if (dynamicParametersEnabled) { - if (optOutQuery.isLoading) { - return ; + if (optOutQuery.isError) { + return ; } if (!optOutQuery.data) { - return ; + return ; } const toggleOptedOut = () => {