Skip to content

Commit

Permalink
rename to PartitionHook.delete
Browse files Browse the repository at this point in the history
and use `delete_` as variable name not to collide with the `delete` operator
  • Loading branch information
mvidner committed Jan 22, 2025
1 parent f2f32f3 commit c3038e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/src/components/storage/DriveEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ const PartitionsNoContentSelector = () => {
};

const PartitionMenuItem = ({ driveName, mountPath }) => {
const { onDelete } = usePartition(driveName, mountPath);
const { delete: delete_ } = usePartition(driveName, mountPath);

return (
<MenuItem
Expand All @@ -587,7 +587,7 @@ const PartitionMenuItem = ({ driveName, mountPath }) => {
icon={<Icon name="delete" size="xs" aria-label={"Delete"} />}
actionId={`delete-${mountPath}`}
aria-label={`Delete ${mountPath}`}
onClick={onDelete}
onClick={delete_}
/>
</>
}
Expand Down
4 changes: 2 additions & 2 deletions web/src/queries/storage/config-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export function useBoot(): BootHook {
}

export type PartitionHook = {
onDelete: () => void;
delete: () => void;
};

// driveName, like "/dev/sda"
Expand All @@ -291,7 +291,7 @@ export function usePartition(driveName: string, mountPath: string): PartitionHoo
if (findPartition(model, driveName, mountPath) === undefined) return;

return {
onDelete: () => mutate(deletePartition(model, driveName, mountPath)),
delete: () => mutate(deletePartition(model, driveName, mountPath)),
};
}

Expand Down

0 comments on commit c3038e0

Please sign in to comment.