From bb21b1347162aa46e2136ab3d1689de8570207b4 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 10 Oct 2024 18:45:54 +0700 Subject: [PATCH] fix: resolve personal environments correctly while editing via quick peek (#4384) Co-authored-by: Dmitry Mukovkin Co-authored-by: nivedin --- .../src/components/environments/my/index.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/hoppscotch-common/src/components/environments/my/index.vue b/packages/hoppscotch-common/src/components/environments/my/index.vue index 86ee2d21..23fdef66 100644 --- a/packages/hoppscotch-common/src/components/environments/my/index.vue +++ b/packages/hoppscotch-common/src/components/environments/my/index.vue @@ -135,12 +135,11 @@ defineActionHandler( "modals.my.environment.edit", ({ envName, variableName, isSecret }) => { if (variableName) editingVariableName.value = variableName - const envIndex: number = - alphabeticallySortedPersonalEnvironments.value.findIndex(({ env }) => { - return env.name === envName - }) - if (envName !== "Global") { - editEnvironment(envIndex) + const env = alphabeticallySortedPersonalEnvironments.value.find( + ({ env }) => env.name === envName + ) + if (envName !== "Global" && env) { + editEnvironment(env.index) secretOptionSelected.value = isSecret ?? false } }