Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
OpenSeadragon.setString('Tooltips.Home', 'Reset zoom');
fetch(`${SLIDE_IMAGE_ENDPOINT}metadata/${this.props.imageId}`)
.then(res => res.json())
.then(data => {
const { imageId, setViewer, setImageParams } = this.props;
if (!data.Format) {
this.props.setLoadError(true);
} else {
this.props.setLoadError(false);
setImageParams({
height: Number(data.Height),
width: Number(data.Width),
overlap: Number(data.Overlap),
tileSize: Number(data.TileSize),
});
const viewer = OpenSeadragon({
id: 'osd1',
item => OpenSeadragon.setString(item.name, `${item.value}`));
}