Skip to content

Commit

Permalink
Merge pull request #4037 from ProjectMirador/osd-tilesource-compare-t…
Browse files Browse the repository at this point in the history
…o-undefined

Expect zero value for opacity and index in OpenSeadragonTileSource
  • Loading branch information
cbeer authored Dec 13, 2024
2 parents 3abaca3 + a9c8da7 commit 2b83ab8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/OpenSeadragonTileSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function OpenSeadragonTileSource({
const tiledImage = useRef(undefined);

useEffect(() => {
if (!opacity) return;
if (opacity == null) return;

tiledImage.current?.setOpacity(opacity);
}, [opacity]);
Expand All @@ -23,7 +23,7 @@ export default function OpenSeadragonTileSource({
}, [fitBounds]);

useEffect(() => {
if (!tiledImage.current || !viewer?.current || !index) return;
if (!tiledImage.current || !viewer?.current || index == null) return;

viewer.current.world.setItemIndex(tiledImage.current, index);
}, [index, viewer]);
Expand Down

0 comments on commit 2b83ab8

Please sign in to comment.