Skip to content
Snippets Groups Projects
Commit 91804cd8 authored by Jack Reed's avatar Jack Reed
Browse files

close viewer on tile change (cleans up existing tileSources)

parent bf0134f7
Branches
No related tags found
No related merge requests found
......@@ -38,11 +38,15 @@ class OpenSeadragonViewer extends Component {
}
/**
* When the tileSources change, make sure to close the OSD viewer.
*/
componentDidUpdate() {
componentDidUpdate(prevProps) {
const { tileSources } = this.props;
if (prevProps.tileSources !== tileSources) {
this.viewer.close();
tileSources.forEach(tileSource => this.addTileSource(tileSource));
}
}
/**
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment