diff --git a/packages/hoppscotch-app/components/environments/Edit.vue b/packages/hoppscotch-app/components/environments/Edit.vue
index fdef5a59b..1972b2abd 100644
--- a/packages/hoppscotch-app/components/environments/Edit.vue
+++ b/packages/hoppscotch-app/components/environments/Edit.vue
@@ -62,6 +62,7 @@
@@ -121,10 +122,12 @@ import {
Environment,
getEnviroment,
getGlobalVariables,
+ globalEnv$,
setGlobalEnvVariables,
updateEnvironment,
} from "~/newstore/environments"
import { parseTemplateStringE } from "~/helpers/templating"
+import { useReadonlyStream } from "~/helpers/utils/composables"
export default defineComponent({
props: {
@@ -135,6 +138,8 @@ export default defineComponent({
},
},
setup(props) {
+ const globalVars = useReadonlyStream(globalEnv$, [])
+
const workingEnv = computed(() => {
if (props.editingEnvironmentIndex === null) return null
@@ -149,6 +154,7 @@ export default defineComponent({
})
return {
+ globalVars,
workingEnv,
}
},
@@ -171,6 +177,20 @@ export default defineComponent({
}
return false
},
+ liveEnvs(): Array<{ key: string; value: string; source: string }> {
+ if (this.evnExpandError) {
+ return []
+ }
+
+ if (this.$props.editingEnvironmentIndex === "Global") {
+ return [...this.vars.map((x) => ({ ...x, source: this.name! }))]
+ } else {
+ return [
+ ...this.vars.map((x) => ({ ...x, source: this.name! })),
+ ...this.globalVars.map((x) => ({ ...x, source: "Global" })),
+ ]
+ }
+ },
},
watch: {
show() {
diff --git a/packages/hoppscotch-app/components/smart/EnvInput.vue b/packages/hoppscotch-app/components/smart/EnvInput.vue
index 81b0b5b89..939be8160 100644
--- a/packages/hoppscotch-app/components/smart/EnvInput.vue
+++ b/packages/hoppscotch-app/components/smart/EnvInput.vue
@@ -16,7 +16,14 @@