Skip to content

Commit 9cdd580

Browse files
committed
merged
1 parent df9990a commit 9cdd580

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ const CreateWorkspacePage: FC = () => {
105105
userParametersQuery.data ? userParametersQuery.data : [],
106106
);
107107

108+
const hasAllRequiredExternalAuth = Boolean(
109+
!isLoadingExternalAuth &&
110+
externalAuth?.every((auth) => auth.optional || auth.authenticated),
111+
);
112+
108113
const autoCreationStartedRef = useRef(false);
109114
const automateWorkspaceCreation = useEffectEvent(async () => {
110115
if (autoCreationStartedRef.current) {
@@ -143,14 +148,15 @@ const CreateWorkspacePage: FC = () => {
143148
</Helmet>
144149
{loadFormDataError && <ErrorAlert error={loadFormDataError} />}
145150
{isLoadingFormData ||
146-
isLoadingExternalAuth ||
147-
autoCreateWorkspaceMutation.isLoading ? (
151+
isLoadingExternalAuth ||
152+
autoCreateWorkspaceMutation.isLoading ? (
148153
<Loader />
149154
) : (
150155
<CreateWorkspacePageView
151156
mode={mode}
152157
defaultName={defaultName}
153158
defaultOwner={me}
159+
hasAllRequiredExternalAuth={hasAllRequiredExternalAuth}
154160
autofillParameters={autofillParameters}
155161
error={createWorkspaceMutation.error}
156162
resetMutation={createWorkspaceMutation.reset}
@@ -198,10 +204,10 @@ const useExternalAuth = (versionId: string | undefined) => {
198204
const { data: externalAuth, isLoading: isLoadingExternalAuth } = useQuery(
199205
versionId
200206
? {
201-
...templateVersionExternalAuth(versionId),
202-
refetchInterval:
203-
externalAuthPollingState === "polling" ? 1000 : false,
204-
}
207+
...templateVersionExternalAuth(versionId),
208+
refetchInterval:
209+
externalAuthPollingState === "polling" ? 1000 : false,
210+
}
205211
: { enabled: false },
206212
);
207213

0 commit comments

Comments
 (0)