Skip to content

Commit 6f3b094

Browse files
Its-treasonslowjoe007
authored andcommitted
fix: Collection variable viewer (usebruno#1947)
Due to changes in usebruno#650 collection variables would be passed as a object but was exptected to be an array. Collection variables are now converted to an array.
1 parent 2915120 commit 6f3b094

File tree

1 file changed

+8
-3
lines changed
  • packages/bruno-app/src/components/VariablesEditor

1 file changed

+8
-3
lines changed

packages/bruno-app/src/components/VariablesEditor/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { findEnvironmentInCollection, maskInputValue } from 'utils/collections';
77
import StyledWrapper from './StyledWrapper';
88
import { IconEye, IconEyeOff } from '@tabler/icons';
99

10-
const KeyValueExplorer = ({ data, theme }) => {
11-
data = data || {};
10+
const KeyValueExplorer = ({ data = [], theme }) => {
1211
const [showSecret, setShowSecret] = useState(false);
1312

1413
return (
@@ -66,11 +65,17 @@ const EnvVariables = ({ collection, theme }) => {
6665
const CollectionVariables = ({ collection, theme }) => {
6766
const collectionVariablesFound = Object.keys(collection.collectionVariables).length > 0;
6867

68+
const collectionVariableArray = Object.entries(collection.collectionVariables).map(([name, value]) => ({
69+
name,
70+
value,
71+
secret: false
72+
}));
73+
6974
return (
7075
<>
7176
<h1 className="font-semibold mb-2">Collection Variables</h1>
7277
{collectionVariablesFound ? (
73-
<KeyValueExplorer data={collection.collectionVariables} theme={theme} />
78+
<KeyValueExplorer data={collectionVariableArray} theme={theme} />
7479
) : (
7580
<div className="muted text-xs">No collection variables found</div>
7681
)}

0 commit comments

Comments
 (0)