@@ -18,6 +18,8 @@ import { EventType } from '../../../../features/achievement/AchievementTypes';
1818import type { BrowserHostPlugin } from '../../../../features/conductor/BrowserHostPlugin' ;
1919import { createConductor } from '../../../../features/conductor/createConductor' ;
2020import { selectConductorEnable } from '../../../../features/conductor/flagConductorEnable' ;
21+ import { selectConductorEvaluatorUrl } from '../../../../features/conductor/flagConductorEvaluatorUrl' ;
22+ import { selectDirectoryLanguageEnable } from '../../../../features/directory/flagDirectoryLanguageEnable' ;
2123import StoriesActions from '../../../../features/stories/StoriesActions' ;
2224import { isSchemeLanguage , type OverallState } from '../../../application/ApplicationTypes' ;
2325import { SideContentType } from '../../../sideContent/SideContentTypes' ;
@@ -463,12 +465,15 @@ export function* evalCodeConductorSaga(
463465 actionType : string ,
464466 storyEnv ?: string
465467) : SagaIterator {
466- const evaluator : IEvaluatorDefinition | undefined = yield call ( getEvaluatorDefinitionSaga ) ;
467- if ( ! evaluator ?. path ) throw Error ( 'no evaluator' ) ;
468- const evaluatorResponse : Response = yield call (
469- fetch ,
470- evaluator . path // temporary evaluator
471- ) ;
468+ let path : string ;
469+ if ( yield select ( selectDirectoryLanguageEnable ) ) {
470+ const evaluator : IEvaluatorDefinition | undefined = yield call ( getEvaluatorDefinitionSaga ) ;
471+ if ( ! evaluator ?. path ) throw Error ( 'no evaluator' ) ;
472+ path = evaluator . path ;
473+ } else {
474+ path = yield select ( selectConductorEvaluatorUrl ) ;
475+ }
476+ const evaluatorResponse : Response = yield call ( fetch , path ) ;
472477 if ( ! evaluatorResponse . ok ) throw Error ( "can't get evaluator" ) ;
473478 const evaluatorBlob : Blob = yield call ( [ evaluatorResponse , 'blob' ] ) ;
474479 const url : string = yield call ( URL . createObjectURL , evaluatorBlob ) ;
0 commit comments