Skip to content
Snippets Groups Projects
Unverified Commit 3d664289 authored by aeschylus's avatar aeschylus Committed by GitHub
Browse files

Merge pull request #1589 from ProjectMirador/close-viewer-on-image-change

close viewer on tile change (cleans up existing tileSources)
parents bf0134f7 91804cd8
Branches
Tags
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