Skip to content

Commit

Permalink
[web] Fix inconsistencies in storage volumes (#1109)
Browse files Browse the repository at this point in the history
This fixes #1108, both the problems and the implemented solutions are
described there in depth.

Tested manually to check both problems are indeed fixed.
  • Loading branch information
ancorgs authored Mar 20, 2024
2 parents 2c81aca + e3da7ea commit 5406333
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/src/components/storage/ProposalPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export default function ProposalPage() {
<ProposalSettingsSection
availableDevices={state.availableDevices}
encryptionMethods={state.encryptionMethods}
volumeTemplates={state.volumeTemplates}
settings={state.settings}
onChange={changeSettings}
isLoading={state.loading}
Expand Down
6 changes: 2 additions & 4 deletions web/src/components/storage/ProposalSettingsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,14 @@ const SnapshotsField = ({
}) => {
const rootVolume = (settings.volumes || []).find((i) => i.mountPath === "/");

const initialChecked = rootVolume !== undefined && hasFS(rootVolume, "Btrfs") && rootVolume.snapshots;
const [isChecked, setIsChecked] = useState(initialChecked);

// no root volume is probably some error or still loading
if (rootVolume === undefined) {
return <Skeleton width="25%" />;
}

const isChecked = rootVolume !== undefined && hasFS(rootVolume, "Btrfs") && rootVolume.snapshots;

const switchState = (_, checked) => {
setIsChecked(checked);
onChange({ active: checked, settings });
};

Expand Down

0 comments on commit 5406333

Please sign in to comment.