viewer.addHandler('page', addPage);
return () => {
viewer.removeHandler('page', addPage);
- viewer.removeOverlay(element);
+ try {
+ viewer.removeOverlay(element);
+ } catch (e) {
+ // bug in OSD?
+ console.error(e);
+ }
};
}
if (viewer.isOpen()) {
viewer.addHandler('open', add);
return () => {
viewer.removeHandler('open', add);
- viewer.removeOverlay(element);
+ try {
+ viewer.removeOverlay(element);
+ } catch (e) {
+ // bug in OSD?
+ console.error(e);
+ }
};
}
}, [onClick, height, page, viewer, width, x, y]);