Repository: freeCodeCamp/freeCodeCamp
File: client/src/templates/Challenges/classic/editor.tsx (TypeScript)

Code before:
    const editor = dataRef.current.editor;
    editor?.changeViewZones(changeAccessor => {
      changeAccessor.removeZone(dataRef.current.descriptionZoneId);
      descriptionZoneCallback(changeAccessor);
    });
  }

  const { theme } = props;

  const preferDarkScheme = window.matchMedia(
    '(prefers-color-scheme: dark)'
  ).matches;
  const editorSystemTheme = preferDarkScheme ? 'vs-dark-custom' : 'vs-custom';
  const editorTheme =
    theme === LocalStorageThemes.Dark
      ? 'vs-dark-custom'
      : theme === LocalStorageThemes.Light
        ? 'vs-custom'
        : editorSystemTheme;

  const firstFailedTest = props.tests.find(test => !!test.err);

  const handleSubmitAndGoButtonBoolean = () => {
    const canShowModal = sessionStorage.getItem('canOpenModal');

    if (canShowModal === 'false' && process.env.NODE_ENV === 'development') {
      return false;
    }
    return challengeIsComplete();
  };

  return (
    <Suspense fallback={<Loader loaderDelay={600} />}>
      <span className='notranslate'>
        <MonacoEditor
          editorDidMount={editorDidMount}
          editorWillMount={editorWillMount}
          onChange={onChange}
          options={{ ...options, folding: !hasEditableRegion() }}
          theme={editorTheme}
        />
      </span>
      {lowerJawContainer !== null &&
        createPortal(
          <LowerJaw
            openHelpModal={props.openHelpModal}
            openResetModal={props.openResetModal}
            tryToExecuteChallenge={tryToExecuteChallenge}
            hint={firstFailedTest?.message}
            testsLength={props.tests.length}
            attempts={attemptsRef.current}

Review comment (suggestion):
```suggestion
    if (canShowModal === 'false' && process.env.FREECODECAMP_NODE_ENV === 'development') {
```

Code after:
  function updateDescriptionZone() {
    const editor = dataRef.current.editor;
    editor?.changeViewZones(changeAccessor => {
      changeAccessor.removeZone(dataRef.current.descriptionZoneId);
      descriptionZoneCallback(changeAccessor);
    });
  }

  const { theme } = props;

  const preferDarkScheme = window.matchMedia(
    '(prefers-color-scheme: dark)'
  ).matches;
  const editorSystemTheme = preferDarkScheme ? 'vs-dark-custom' : 'vs-custom';
  const editorTheme =
    theme === LocalStorageThemes.Dark
      ? 'vs-dark-custom'
      : theme === LocalStorageThemes.Light
        ? 'vs-custom'
        : editorSystemTheme;

  const firstFailedTest = props.tests.find(test => !!test.err);

  const handleSubmitAndGoButtonBoolean = () => {
    const canShowModal = sessionStorage.getItem('canOpenModal');

    if (canShowModal === 'false' && envConfig.environment === 'development') {
      return false;
    }
    return challengeIsComplete();
  };

  return (
    <Suspense fallback={<Loader loaderDelay={600} />}>
      <span className='notranslate'>
        <MonacoEditor
          editorDidMount={editorDidMount}
          editorWillMount={editorWillMount}
          onChange={onChange}
          options={{ ...options, folding: !hasEditableRegion() }}
          theme={editorTheme}
        />
      </span>
      {lowerJawContainer !== null &&
        createPortal(
          <LowerJaw
            openHelpModal={props.openHelpModal}
            openResetModal={props.openResetModal}
            tryToExecuteChallenge={tryToExecuteChallenge}
            hint={firstFailedTest?.message}
            testsLength={props.tests.length}