Refactor sidebar

This commit is contained in:
Thomas Nordquist
2019-07-07 16:24:18 +02:00
parent 6bead5b5a6
commit b79725bdf0
16 changed files with 420 additions and 313 deletions

View File

@@ -63,7 +63,7 @@ function TreeNodeSubnodes(props: Props) {
})
return <span className={props.classes.list}>{listItems}</span>
}, [alreadyAdded, props.lastUpdate, props.theme])
}, [alreadyAdded, props.treeNode.lastUpdate, props.theme])
}
const styles = (theme: Theme) => ({

View File

@@ -133,7 +133,7 @@ function TreeNodeComponent(props: Props) {
{renderNodes()}
</div>
)
}, [lastUpdate, treeNode, name, isCollapsed, selected, theme])
}, [treeNode.lastUpdate, treeNode, name, isCollapsed, selected, theme])
}
export default withStyles(styles, { withTheme: true })(TreeNodeComponent)

View File

@@ -99,8 +99,8 @@ class TreeComponent extends React.PureComponent<Props, State> {
this.updateTimer = undefined
this.renderTime = performance.now()
if (!this.props.paused) {
this.props.tree && this.props.tree.applyUnmergedChanges()
if (!this.props.paused && this.props.tree) {
this.props.tree.applyUnmergedChanges()
}
window.requestIdleCallback(
() => {