diff --git a/app/ui/components/modals/WorkspaceEnvironmentsEditModal.js b/app/ui/components/modals/WorkspaceEnvironmentsEditModal.js index 733c0e62b..9f030b5a2 100644 --- a/app/ui/components/modals/WorkspaceEnvironmentsEditModal.js +++ b/app/ui/components/modals/WorkspaceEnvironmentsEditModal.js @@ -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; }