Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa7411c

Browse files
Update site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
use option?.value instead of index to check whether we should send a preset ID when a workspace is created Co-authored-by: Susana Ferreira <[email protected]>
1 parent 927e66e commit fa7411c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
369369
setSelectedPresetIndex(index);
370370
form.setFieldValue(
371371
"template_version_preset_id",
372-
index === 0 ? undefined : option?.value,
372+
// Empty string is equivalent to using None
373+
option?.value === "" ? undefined : option?.value,
373374
);
374375
}}
375376
placeholder="Select a preset"

0 commit comments

Comments
 (0)