fix updating of unmounted progress bar

This commit is contained in:
oleg 2015-11-19 21:24:13 +03:00
parent 059a6fe00c
commit bfdfaa9be2
2 changed files with 12 additions and 9 deletions

View File

@ -31,10 +31,10 @@ Ui fixes
* ~~projects autocomplete~~ * ~~projects autocomplete~~
* ~~add time ago to build list~~ * ~~add time ago to build list~~
* ~~show scm changes on build page~~ * ~~show scm changes on build page~~
* react says many many times to console: * ~~react says many many times to console:~~
Warning: setState(...): Can only update a mounted or mounting component. ~~Warning: setState(...): Can only update a mounted or mounting component.~~
This usually means you called setState() on an unmounted component. ~~This usually means you called setState() on an unmounted component.~~
This is a no-op. ~~This is a no-op.~~
* show duration details (steps duration) on build page * show duration details (steps duration) on build page
* speed up build points animation at ff * speed up build points animation at ff
* current successfully streak icons at project page * current successfully streak icons at project page

View File

@ -13,13 +13,16 @@ define([
build.project.avgBuildDuration * 100); build.project.avgBuildDuration * 100);
}, },
componentDidMount: function() { componentDidMount: function() {
var self = this, var self = this;
updateCallback = function() { var updateCallback = function() {
if (self.props.build.status === 'in-progress') { if (self.props.build.status === 'in-progress') {
self.setState({percent: self._computePercent()}); if (self.isMounted()) {
_.delay(updateCallback, 100); self.setState({percent: self._computePercent()});
_.delay(updateCallback, 100);
}
} }
} };
updateCallback(); updateCallback();
}, },
getInitialState: function() { getInitialState: function() {