Skip to content

Commit

Permalink
fix(web): prevent crash when deleting a drive, remaining places
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jan 30, 2025
1 parent fe8a42e commit f99e81c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/src/components/storage/DriveEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ const SpacePolicySelector = ({ drive, driveDevice }: DriveEditorProps) => {
};

const SearchSelectorIntro = ({ drive }: { drive: configModel.Drive }) => {
const { isBoot, isExplicitBoot } = useDrive(drive.name);
const driveModel = useDrive(drive.name);
if (!driveModel) return;

const { isBoot, isExplicitBoot } = driveModel;
// TODO: Get volume groups associated to the drive.
const volumeGroups = [];

Expand Down Expand Up @@ -357,7 +360,10 @@ const SearchSelectorSingleOption = ({ selected }) => {
};

const SearchSelectorOptions = ({ drive, selected, onChange }) => {
const { isExplicitBoot } = useDrive(drive.name);
const driveModel = useDrive(drive.name);
if (!driveModel) return;

const { isExplicitBoot } = driveModel;
// const boot = isExplicitBoot(drive.name);

if (driveUtils.hasReuse(drive)) return <SearchSelectorSingleOption selected={selected} />;
Expand Down

0 comments on commit f99e81c

Please sign in to comment.