Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views / workbench / workbench.tsx
index 4a2cd7009804335bfb5534946cc7cbbf529d46e9..bc2396f7cf8c2930444d6ecb3bb80324a9d5326d 100644 (file)
@@ -300,7 +300,7 @@ const applyCollapsedState = isCollapsed => {
 
 export const WorkbenchPanel = withStyles(styles)((props: WorkbenchPanelProps) => {
     //panel size will not scale automatically on window resize, so we do it manually
-    window.addEventListener("resize", () => applyCollapsedState(props.sidePanelIsCollapsed));
+    if (props && props.sidePanelIsCollapsed) window.addEventListener("resize", () => applyCollapsedState(props.sidePanelIsCollapsed));
     applyCollapsedState(props.sidePanelIsCollapsed);
 
     return (