Skip to content

Commit

Permalink
fix(orientation-marker): remove if viewport is undefined (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE committed Apr 30, 2024
1 parent e511c3f commit fe511d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/tools/src/tools/OrientationMarkerTool.ts
Expand Up @@ -170,10 +170,14 @@ class OrientationMarkerTool extends BaseTool {
const resizeObserver = new ResizeObserver(() => {
// Todo: i wish there was a better way to do this
setTimeout(() => {
const { viewport } = getEnabledElementByIds(
const element = getEnabledElementByIds(
viewportId,
renderingEngineId
);
if (!element){
return
}
const { viewport } = element
this.resize(viewportId);
viewport.render();
}, 100);
Expand Down

0 comments on commit fe511d9

Please sign in to comment.