diff --git a/app/ContainerDetails.react.js b/app/ContainerDetails.react.js index 31e3fcdcee..ed0b7e56ef 100644 --- a/app/ContainerDetails.react.js +++ b/app/ContainerDetails.react.js @@ -136,8 +136,19 @@ var ContainerDetails = React.createClass({ } envVarList.push(key + '=' + val); }); - ContainerStore.updateContainer(this.props.container.Name, { + var self = this; + ContainerStore.updateContainer(self.props.container.Name, { Env: envVarList + }, function (err) { + if (err) { + console.error(err); + } else { + self.setState({ + pendingEnv: {} + }); + $('#new-env-key').val(''); + $('#new-env-val').val(''); + } }); }, handleAddPendingEnvVar: function () { diff --git a/app/ContainerStore.js b/app/ContainerStore.js index 504bd658d7..072390ea84 100644 --- a/app/ContainerStore.js +++ b/app/ContainerStore.js @@ -395,12 +395,13 @@ var ContainerStore = assign(EventEmitter.prototype, { } }); }, - updateContainer: function (name, data) { + updateContainer: function (name, data, callback) { _muted[name] = true; var fullData = assign(_containers[name], data); this._createContainer(name, fullData, function (err) { this.emit(this.CLIENT_CONTAINER_EVENT, name); _muted[name] = false; + callback(err); }.bind(this)); }, remove: function (name, callback) {