From 40e8696a9a9bc06e6f9151009b8f1a37fa3352a6 Mon Sep 17 00:00:00 2001 From: nivedin Date: Thu, 7 Mar 2024 18:33:55 +0530 Subject: [PATCH] fix: secret env bug in firebase due to undefined value --- .../src/components/environments/my/Details.vue | 4 +--- .../src/components/environments/teams/Details.vue | 10 ++++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/hoppscotch-common/src/components/environments/my/Details.vue b/packages/hoppscotch-common/src/components/environments/my/Details.vue index 8327e8dd3..7b8969249 100644 --- a/packages/hoppscotch-common/src/components/environments/my/Details.vue +++ b/packages/hoppscotch-common/src/components/environments/my/Details.vue @@ -416,9 +416,7 @@ const saveEnvironment = () => { const variables = pipe( filteredVariables, - A.map((e) => - e.secret ? { key: e.key, secret: e.secret, value: undefined } : e - ) + A.map((e) => (e.secret ? { key: e.key, secret: e.secret } : e)) ) const environmentUpdated: Environment = { diff --git a/packages/hoppscotch-common/src/components/environments/teams/Details.vue b/packages/hoppscotch-common/src/components/environments/teams/Details.vue index 1f9673e2a..6af413e1e 100644 --- a/packages/hoppscotch-common/src/components/environments/teams/Details.vue +++ b/packages/hoppscotch-common/src/components/environments/teams/Details.vue @@ -360,7 +360,7 @@ const saveEnvironment = async () => { return } - const filterdVariables = pipe( + const filteredVariables = pipe( vars.value, A.filterMap( flow( @@ -371,17 +371,15 @@ const saveEnvironment = async () => { ) const secretVariables = pipe( - filterdVariables, + filteredVariables, A.filterMapWithIndex((i, e) => e.secret ? O.some({ key: e.key, value: e.value, varIndex: i }) : O.none ) ) const variables = pipe( - filterdVariables, - A.map((e) => - e.secret ? { key: e.key, secret: e.secret, value: undefined } : e - ) + filteredVariables, + A.map((e) => (e.secret ? { key: e.key, secret: e.secret } : e)) ) const environmentUpdated: Environment = {