Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #543 from jippi/zh-fix-in-sync
Browse files Browse the repository at this point in the history
Fix services -> in sync column stuck on question mark (jobs page)
  • Loading branch information
jippi committed Feb 21, 2020
2 parents 3544b0c + 899eb8d commit 8c00fad
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions frontend/src/components/JobHealth/JobHealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,34 @@ export { JobHealthCell }

class JobHealth extends PureComponent {
componentDidMount() {
this.watch(this.props.jobID);
}

componentWillUnmount() {
this.unwatch(this.props.jobID);
}

componentDidUpdate(prevProps) {
if (prevProps.jobID !== this.props.jobID) {
this.unwatch(prevProps.jobID);
this.watch(this.props.jobID);
}
}

unwatch = jobID => {
this.props.dispatch({
type: NOMAD_WATCH_JOB_HEALTH,
type: NOMAD_UNWATCH_JOB_HEALTH,
payload: {
id: this.props.jobID
id: jobID
}
})
}

componentWillUnmount() {
watch = jobID => {
this.props.dispatch({
type: NOMAD_UNWATCH_JOB_HEALTH,
type: NOMAD_WATCH_JOB_HEALTH,
payload: {
id: this.props.jobID
id: jobID
}
})
}
Expand Down

0 comments on commit 8c00fad

Please sign in to comment.