From b9c7df33e7fb416ca9853155f555da12092b642c Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 7 Dec 2016 23:16:09 -0800 Subject: [PATCH] Fix environment editing when switching requests --- app/ui/components/modals/WorkspaceEnvironmentsEditModal.js | 5 +++++ 1 file changed, 5 insertions(+) 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; }