Skip to content

Commit

Permalink
fix: Request vars displayed in red color in body even if they are val…
Browse files Browse the repository at this point in the history
…id (#3812)

* fix: Request vars displayed in red color in body
* chore: removing index import
---------

Co-authored-by: Anoop M D <[email protected]>
  • Loading branch information
naman-bruno and helloanoop authored Jan 16, 2025
1 parent 63d3cb3 commit a73d2a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/bruno-app/src/components/CodeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import React from 'react';
import { isEqual, escapeRegExp } from 'lodash';
import { getEnvironmentVariables } from 'utils/collections';
import { defineCodeMirrorBrunoVariablesMode } from 'utils/common/codemirror';
import StyledWrapper from './StyledWrapper';
import * as jsonlint from '@prantlf/jsonlint';
import { JSHINT } from 'jshint';
import stripJsonComments from 'strip-json-comments';
import { getAllVariables } from 'utils/collections';

let CodeMirror;
const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
Expand Down Expand Up @@ -293,7 +293,7 @@ export default class CodeEditor extends React.Component {
}

if (this.editor) {
let variables = getEnvironmentVariables(this.props.collection);
let variables = getAllVariables(this.props.collection, this.props.item);
if (!isEqual(variables, this.variables)) {
this.addOverlay();
}
Expand Down Expand Up @@ -333,7 +333,7 @@ export default class CodeEditor extends React.Component {

addOverlay = () => {
const mode = this.props.mode || 'application/ld+json';
let variables = getEnvironmentVariables(this.props.collection);
let variables = getAllVariables(this.props.collection, this.props.item);
this.variables = variables;

defineCodeMirrorBrunoVariablesMode(variables, mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const RequestBody = ({ item, collection }) => {
<StyledWrapper className="w-full">
<CodeEditor
collection={collection}
item={item}
theme={displayedTheme}
font={get(preferences, 'font.codeFont', 'default')}
fontSize={get(preferences, 'font.codeFontSize')}
Expand Down

0 comments on commit a73d2a0

Please sign in to comment.