Skip to content

Commit

Permalink
fix: return if/else with commment when closing details page
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <dgolovin@redhat.com>
  • Loading branch information
dgolovin committed Sep 14, 2023
1 parent 1708563 commit caf7760
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/renderer/src/lib/image/ImageDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ onMount(() => {
// loading image info
return imagesInfos.subscribe(images => {
const matchingImage = images.find(c => c.Id === imageID && c.engineId === engineId);
let tempImage;
if (matchingImage) {
const tempImage = imageUtils.getImageInfoUI(matchingImage, base64RepoTag);
if (tempImage) {
image = tempImage;
return;
}
tempImage = imageUtils.getImageInfoUI(matchingImage, base64RepoTag);
}
if (tempImage) {
image = tempImage;
} else {
// the image has been deleted
detailsPage.close();
}
detailsPage.close();
});
});
</script>
Expand Down

0 comments on commit caf7760

Please sign in to comment.