mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-11 22:01:07 -04:00
fix: have console open for all JS challenges (#58808)
This commit is contained in:
committed by
GitHub
parent
40958082ce
commit
ceb0e60460
@@ -63,6 +63,7 @@ import { preloadPage } from '../../../../utils/gatsby/page-loading';
|
||||
import envData from '../../../../config/env.json';
|
||||
import ToolPanel from '../components/tool-panel';
|
||||
import { getChallengePaths } from '../utils/challenge-paths';
|
||||
import { isJavaScriptChallenge } from '../utils/build';
|
||||
import { XtermTerminal } from './xterm';
|
||||
import MultifileEditor from './multifile-editor';
|
||||
import DesktopLayout from './desktop-layout';
|
||||
@@ -240,7 +241,7 @@ function ShowClassic({
|
||||
`intro:${superBlock}.blocks.${block}.title`
|
||||
)}: ${title}`;
|
||||
const windowTitle = `${blockNameTitle} | freeCodeCamp.org`;
|
||||
const showConsole = challengeType === challengeTypes.js;
|
||||
const openConsole = isJavaScriptChallenge({ challengeType });
|
||||
// TODO: show preview should NOT be computed like this. That determination is
|
||||
// made during the build (at least twice!). It should be either a prop or
|
||||
// computed from challengeType
|
||||
@@ -519,7 +520,7 @@ function ShowClassic({
|
||||
<Output defaultOutput={defaultOutput} output={output} />
|
||||
}
|
||||
windowTitle={windowTitle}
|
||||
startWithConsoleShown={showConsole}
|
||||
startWithConsoleShown={openConsole}
|
||||
/>
|
||||
)}
|
||||
<CompletionModal />
|
||||
|
||||
@@ -406,7 +406,9 @@ export function challengeHasPreview({ challengeType }: ChallengeMeta): boolean {
|
||||
|
||||
export function isJavaScriptChallenge({
|
||||
challengeType
|
||||
}: ChallengeMeta): boolean {
|
||||
}: {
|
||||
challengeType: number;
|
||||
}): boolean {
|
||||
return (
|
||||
challengeType === challengeTypes.js ||
|
||||
challengeType === challengeTypes.jsProject
|
||||
|
||||
Reference in New Issue
Block a user