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~~
* ~~add time ago to build list~~
* ~~show scm changes on build page~~
* react says many many times to console:
Warning: setState(...): Can only update a mounted or mounting component.
This usually means you called setState() on an unmounted component.
This is a no-op.
* ~~react says many many times to console:~~
~~Warning: setState(...): Can only update a mounted or mounting component.~~
~~This usually means you called setState() on an unmounted component.~~
~~This is a no-op.~~
* show duration details (steps duration) on build page
* speed up build points animation at ff
* current successfully streak icons at project page

View File

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