Browse Source

Merge "web: prevent status update loop in background"

changes/28/636728/3
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
91fb92978e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      web/src/pages/Status.jsx

+ 2
- 1
web/src/pages/Status.jsx View File

@ -84,7 +84,7 @@ class StatusPage extends Refreshable {
updateData = (force) => {
if (force || (this.visible && this.state.autoReload)) {
this.props.dispatch(fetchStatusIfNeeded(this.props.tenant))
.then(() => {if (this.state.autoReload) {
.then(() => {if (this.state.autoReload && this.visible) {
this.timer = setTimeout(this.updateData, 5000)
}})
}
@ -106,6 +106,7 @@ class StatusPage extends Refreshable {
clearTimeout(this.timer)
this.timer = null
}
this.visible = false
document.removeEventListener(
this.visibilityChangeEvent, this.visibilityListener)
}


Loading…
Cancel
Save