diff --git a/src/features/linodes/LinodesCreate/LinodeCreateContainer.tsx b/src/features/linodes/LinodesCreate/LinodeCreateContainer.tsx index 0c2e3d99b10..6f1a661f1ee 100644 --- a/src/features/linodes/LinodesCreate/LinodeCreateContainer.tsx +++ b/src/features/linodes/LinodesCreate/LinodeCreateContainer.tsx @@ -215,12 +215,11 @@ class LinodeCreateContainer extends React.PureComponent { defaultData?: any ) => { /** - * reset the selected Image but only if we're creating a Linode from - * a StackScript and not an app + * If we're switching from one cloud app to another, + * usually the only compatible image will be Debian 9. If this + * is the case, preselect that value. */ - if (this.props.createType !== 'fromApp') { - this.setState({ selectedImageID: undefined }); - } + const defaultImage = images.length === 1 ? images[0].id : undefined; this.setState({ selectedStackScriptID: id, @@ -230,7 +229,7 @@ class LinodeCreateContainer extends React.PureComponent { availableStackScriptImages: images, udfs: defaultData, /** reset image because stackscript might not be compatible with selected one */ - selectedImageID: undefined, + selectedImageID: defaultImage, errors: undefined }); };