Fix environment editing when switching requests

This commit is contained in:
Gregory Schier 2016-12-07 23:16:09 -08:00
parent 2301000a4b
commit b9c7df33e7

View File

@ -42,7 +42,12 @@ class WorkspaceEnvironmentsEditModal extends Component {
if (environmentToActivate) {
activeEnvironmentId = environmentToActivate._id
} else if (this.state.workspace && workspace._id !== this.state.workspace._id) {
// We've changed workspaces, so load the root one
activeEnvironmentId = rootEnvironment._id;
} else {
// We haven't changed workspaces, so try loading the last environment, and fall back
// to the root one
activeEnvironmentId = this.state.activeEnvironmentId || rootEnvironment._id;
}