mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
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.
This commit is contained in:
@ -44,11 +44,11 @@ const CreateWorkspaceExperimentRouter: FC = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (dynamicParametersEnabled) {
|
if (dynamicParametersEnabled) {
|
||||||
if (optOutQuery.isLoading) {
|
if (optOutQuery.isError) {
|
||||||
return <Loader />;
|
return <ErrorAlert error={optOutQuery.error} />;
|
||||||
}
|
}
|
||||||
if (!optOutQuery.data) {
|
if (!optOutQuery.data) {
|
||||||
return <ErrorAlert error={optOutQuery.error} />;
|
return <Loader />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleOptedOut = () => {
|
const toggleOptedOut = () => {
|
||||||
|
Reference in New Issue
Block a user