Add pause feature

This commit is contained in:
Thomas Nordquist
2019-04-03 17:57:19 +02:00
parent 8266a87417
commit 094d795b39
6 changed files with 191 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ interface Props {
autoExpandLimit: number
highlightTopicUpdates: boolean
selectTopicWithMouseOver: boolean
paused: boolean
}
interface State {
@@ -78,7 +79,10 @@ class Tree extends React.PureComponent<Props, State> {
this.updateTimer && clearTimeout(this.updateTimer)
this.updateTimer = undefined
this.renderTime = performance.now()
this.props.tree && this.props.tree.applyUnmergedChanges()
if (!this.props.paused) {
this.props.tree && this.props.tree.applyUnmergedChanges()
}
window.requestIdleCallback(() => {
this.setState({ lastUpdate: this.renderTime })
}, { timeout: 100 })
@@ -126,6 +130,7 @@ class Tree extends React.PureComponent<Props, State> {
const mapStateToProps = (state: AppState) => {
return {
tree: state.tree.tree,
paused: state.tree.paused,
filter: state.tree.filter,
host: state.connection.host,
autoExpandLimit: state.settings.autoExpandLimit,