Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: remove legacy global env preRequest reference

Andrew Bastin91fee8d2d0cf
diff --git a/helpers/preRequest.ts b/helpers/preRequest.ts
index b0ce2a1f4..48ce28636 100644
--- a/helpers/preRequest.ts
+++ b/helpers/preRequest.ts
@@ -1,6 +1,6 @@
import {
getCurrentEnvironment,
- getLegacyGlobalEnvironment,
+ getGlobalVariables,
} from "~/newstore/environments"
export default function getEnvironmentVariablesFromScript(script: string) {
@@ -12,10 +12,10 @@ export default function getEnvironmentVariablesFromScript(script: string) {
_variables[variable.key] = variable.value
}
- const globalEnv = getLegacyGlobalEnvironment()
+ const globalEnv = getGlobalVariables()
if (globalEnv) {
- for (const variable of globalEnv.variables) {
+ for (const variable of globalEnv) {
_variables[variable.key] = variable.value
}
}
diff --git a/newstore/environments.ts b/newstore/environments.ts
index ebb26f50a..1d21b6b9f 100644
--- a/newstore/environments.ts
+++ b/newstore/environments.ts
@@ -278,7 +278,7 @@ export const aggregateEnvs$ = combineLatest([
results.push({ key, value, sourceEnv: "global" })
)
- return results
+ return results
})
)