Skip to content

Commit

Permalink
fix(useCurrentImage): return defaults/null
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Feb 12, 2024
1 parent a47189c commit 50ad98d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/composables/useCurrentImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ export function getImageSpatialExtent(imageID: Maybe<string>) {

export function getImageMetadata(imageID: Maybe<string>) {
const { metadata } = useImageStore();
return imageID ? metadata[imageID] : defaultImageMetadata();
if (!imageID) return defaultImageMetadata();
return metadata[imageID] ?? defaultImageMetadata();
}

export function getImageData(imageID: Maybe<string>) {
const { dataIndex } = useImageStore();
return imageID ? dataIndex[imageID] : null;
return imageID ? dataIndex[imageID] ?? null : null;
}

export function getIsImageLoading(imageID: Maybe<string>) {
Expand Down

0 comments on commit 50ad98d

Please sign in to comment.