UX-236 - Fix a bug in ExtensionPoint blocking unmounting, bump version number

This commit is contained in:
Josh McDonald 2016-04-05 17:45:07 +10:00
parent 3592af38fb
commit e0644462c0
2 changed files with 14 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@jenkins-cd/js-extensions",
"version": "0.0.8",
"version": "0.0.9",
"description": "Jenkins Extension Store",
"main": "index.js",
"files": ["index.js","dist","README.md"],

View File

@ -101,17 +101,20 @@ var ExtensionPoint = React.createClass({
* would otherwise not be notified when this is being unmounted.
*/
_unmountAllExtensions: function() {
var children = ReactDOM.findDOMNode(this).children;
for (var i = 0; i < children.length; i++) {
var child = children[i];
try {
if (child) {
ReactDOM.unmountComponentAtNode(child);
var thisNode = ReactDOM.findDOMNode(this);
var children = thisNode ? thisNode.children : null;
if (children && children.length) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
try {
if (child) {
ReactDOM.unmountComponentAtNode(child);
}
}
catch (err) {
// Log and continue, don't want to stop unmounting children
console.log("Error unmounting component", child, err);
}
}
catch (err) {
// Log and continue, don't want to stop unmounting children
console.log("Error unmounting component", child, err);
}
}
}