Skip to content

Commit

Permalink
fix: enable deletion of images queued for download
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay-Topher committed Mar 26, 2024
1 parent bb3080b commit 84f1fc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/images/components/ImagesTable/ImagesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ it("disables delete action for images being downloaded", async () => {
title: "18.04 LTS",
complete: false,
status: "Downloading 50%",
downloading: true,
}),
];
const image = {
Expand Down
4 changes: 3 additions & 1 deletion src/app/images/components/ImagesTable/ImagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ const generateResourceRow = ({
const { os, release } = splitResourceName(resource.name);
const isCommissioningImage =
os === "ubuntu" && release === commissioningRelease;
const canBeDeleted = !isCommissioningImage && resource.complete;
const canBeDeleted =
(!isCommissioningImage && resource.complete) ||
(!isCommissioningImage && !resource.downloading);
let statusIcon = <Spinner />;
let statusText = resource.status;

Expand Down

0 comments on commit 84f1fc4

Please sign in to comment.