Skip to content

Commit 2a35fe2

Browse files
committed
chore: updates for PR review
1 parent b7d0d32 commit 2a35fe2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,9 @@ export const MultiSelectCombobox = forwardRef<
205205
const [isLoading, setIsLoading] = useState(false);
206206
const dropdownRef = useRef<HTMLDivElement>(null);
207207

208-
const [selected, setSelected] = useState<Option[]>(() => {
209-
if (arrayDefaultOptions && arrayDefaultOptions.length > 0) {
210-
return arrayDefaultOptions;
211-
}
212-
return [];
213-
});
208+
const [selected, setSelected] = useState<Option[]>(
209+
arrayDefaultOptions ?? [],
210+
);
214211
const [options, setOptions] = useState<GroupOption>(
215212
transitionToGroupOption(arrayDefaultOptions, groupBy),
216213
);

site/src/pages/CreateWorkspacePage/CreateWorkspacePageExperimental.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ const CreateWorkspacePageExperimental: FC = () => {
180180
<title>{pageTitle(title)}</title>
181181
</Helmet>
182182
{!currentResponse ||
183+
!templateQuery.data ||
183184
isLoadingFormData ||
184185
isLoadingExternalAuth ||
185186
autoCreateReady ? (
@@ -199,7 +200,7 @@ const CreateWorkspacePageExperimental: FC = () => {
199200
autoCreateWorkspaceMutation.error
200201
}
201202
resetMutation={createWorkspaceMutation.reset}
202-
template={templateQuery.data ?? ({} as Template)}
203+
template={templateQuery.data}
203204
versionId={realizedVersionId}
204205
externalAuth={externalAuth ?? []}
205206
externalAuthPollingState={externalAuthPollingState}

0 commit comments

Comments
 (0)