Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [M3-7804] - Volume Create Drawer Crash (Linode detail) #10225

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10225-fixed-1708720961774.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Linode storage Volume Create Drawer crash ([#10225](https://github.com/linode/manager/pull/10225))
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ export const ConfigSelect = React.memo((props: Props) => {
return { label: config.label, value: config.id };
});

React.useEffect(() => {
if (configList?.length === 1) {
const newValue = configList[0].value;
if (value !== newValue) {
onChange(configList[0].value);
}
}
}, [configList, onChange, value]);
// If there's only one config, select it by default
const defaultConfig = configList?.length === 1 ? configList[0] : null;

if (linodeId === null) {
return null;
Expand All @@ -69,6 +63,7 @@ export const ConfigSelect = React.memo((props: Props) => {
onChange={(e: Item<number>) => {
onChange(+e.value);
}}
defaultValue={defaultConfig}
id={name}
isClearable={false}
label="Config"
Expand Down
Loading