diff --git a/src/components/Playground.tsx b/src/components/Playground.tsx index 8f67e1539f..997c6d8bd0 100755 --- a/src/components/Playground.tsx +++ b/src/components/Playground.tsx @@ -192,19 +192,25 @@ class Playground extends React.Component { /> ); - const tabs: SideContentTab[] = [ - playgroundIntroductionTab, - listVisualizerTab, - inspectorTab, - envVisualizerTab - ]; + const tabs: SideContentTab[] = [playgroundIntroductionTab]; + // Conditional logic for tab rendering if ( this.props.externalLibraryName === ExternalLibraryNames.PIXNFLIX || this.props.externalLibraryName === ExternalLibraryNames.ALL ) { + // Enable video tab only when 'PIX&FLIX' is selected tabs.push(videoDisplayTab); } + if (this.props.sourceChapter >= 2) { + // Enable Data Visualizer for Source Chapter 2 and above + tabs.push(listVisualizerTab); + } + if (this.props.sourceChapter >= 3) { + // Enable Inspector, Env Visualizer for Source Chapter 3 and above + tabs.push(inspectorTab); + tabs.push(envVisualizerTab); + } const workspaceProps: WorkspaceProps = { controlBarProps: { diff --git a/src/sagas/workspaces.ts b/src/sagas/workspaces.ts index 2bdb4a42dc..f5246c53a6 100644 --- a/src/sagas/workspaces.ts +++ b/src/sagas/workspaces.ts @@ -376,7 +376,7 @@ export function* evalCode( context.runtime.debuggerOn = (actionType === actionTypes.EVAL_EDITOR || actionType === actionTypes.DEBUG_RESUME) && context.chapter > 2; - if (!context.runtime.debuggerOn) { + if (!context.runtime.debuggerOn && context.chapter > 2) { inspectorUpdate(undefined); // effectively resets the interface } const { result, interrupted, paused } = yield race({