Inject globals env into pre-request scripts

This commit is contained in:
Andrew Bastin
2021-06-05 21:07:06 -04:00
parent d9aa965069
commit ddbc9ca61b
2 changed files with 22 additions and 1 deletions

View File

@@ -216,6 +216,16 @@ export function setCurrentEnvironment(newEnvIndex: number) {
})
}
export function getGlobalEnvironment(): Environment | null {
const envs = environmentsStore.value.environments
const el = envs.find(
(env) => env.name === "globals" || env.name === "Globals"
)
return el ?? null
}
export function replaceEnvironments(newEnvironments: any[]) {
environmentsStore.dispatch({
dispatcher: "replaceEnvironments",