diff --git a/packages/hoppscotch-common/src/helpers/RequestRunner.ts b/packages/hoppscotch-common/src/helpers/RequestRunner.ts index 7d1f3a9b3..93e0bba8d 100644 --- a/packages/hoppscotch-common/src/helpers/RequestRunner.ts +++ b/packages/hoppscotch-common/src/helpers/RequestRunner.ts @@ -131,10 +131,15 @@ export function runRESTRequest$( tab.value.document.testResults = translateToSandboxTestResults( runResult.right ) - - setGlobalEnvVariables(runResult.right.envs.global) - if ( + environmentsStore.value.selectedEnvironmentIndex.type === + "NO_ENV_SELECTED" + ) { + setGlobalEnvVariables([ + ...runResult.right.envs.global, + ...runResult.right.envs.selected, + ]) + } else if ( environmentsStore.value.selectedEnvironmentIndex.type === "MY_ENV" ) { const env = getEnvironment({