Skip to content

Commit

Permalink
fix: disks with no bin items cannot be targets (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrodriguez authored Aug 9, 2024
1 parent 67b6417 commit cd3d100
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ui/src/flows/gather/transfer/target.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const Target: React.FunctionComponent = () => {
}

// if no bin then this disk isn't elegible as a target
const elegible = disks.filter((disk) => plan.vdisks[disk.path].bin);
const elegible = disks.filter(
(disk) => plan.vdisks[disk.path].bin && plan.vdisks[disk.path].bin.items,
);

// sort elegible disks by least amount of data transfer
const targets = elegible.sort((a, b) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/bin/bin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Bin: React.FunctionComponent<BinProps> = ({ disk = '' }) => {

const bin = plan.vdisks[disk].bin;

if (!bin) {
if (!bin || !bin.items) {
return (
<div className="h-full bg-neutral-100 dark:bg-gray-950">
<div className="flex flex-col p-2">
Expand Down

0 comments on commit cd3d100

Please sign in to comment.