File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11import { OverallState } from '../application/ApplicationTypes' ;
2+ import { FeatureFlag } from './FeatureFlag' ;
23
3- export const featureSelector = ( flagName : string ) => ( state : OverallState ) =>
4- state . featureFlags . modifiedFlags [ flagName ] ;
4+ export const featureSelector = ( featureFlag : FeatureFlag < any > ) => ( state : OverallState ) =>
5+ state . featureFlags . modifiedFlags [ featureFlag . flagName ] ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { FeatureFlag } from './FeatureFlag';
55import { featureSelector } from './featureSelector' ;
66
77export function * selectFeatureSaga < T > ( featureFlag : FeatureFlag < T > ) : SagaIterator < T > {
8- const { flagName , defaultValue } = featureFlag ;
9- const flagValue = yield select ( featureSelector ( flagName ) ) ;
8+ const { defaultValue } = featureFlag ;
9+ const flagValue = yield select ( featureSelector ( featureFlag ) ) ;
1010 return flagValue ?? defaultValue ;
1111}
Original file line number Diff line number Diff line change 11import { ActionReducerMapBuilder } from '@reduxjs/toolkit' ;
2+ import { selectConductorEnable } from 'src/features/conductor/flagConductorEnable' ;
3+ import { store } from 'src/pages/createStore' ;
24
35import { CodeOutput , InterpreterOutput } from '../../application/ApplicationTypes' ;
46import Constants from '../../utils/Constants' ;
@@ -103,6 +105,9 @@ export const handleReplActions = (builder: ActionReducerMapBuilder<WorkspaceMana
103105 state [ workspaceLocation ] . replHistory . records = newReplHistoryRecords ;
104106 } )
105107 . addCase ( WorkspaceActions . evalRepl , ( state , action ) => {
108+ if ( selectConductorEnable ( store . getState ( ) ) ) {
109+ return ; // no-op: either we will already be running, or it will not start running
110+ }
106111 const workspaceLocation = getWorkspaceLocation ( action ) ;
107112 state [ workspaceLocation ] . isRunning = true ;
108113 } )
Original file line number Diff line number Diff line change 11import { createFeatureFlag } from 'src/commons/featureFlags' ;
2+ import { featureSelector } from 'src/commons/featureFlags/featureSelector' ;
23
34export const flagConductorEnable = createFeatureFlag (
45 'conductor.enable' ,
56 false ,
67 'Enables the Conductor framework for evaluation of user programs.'
78) ;
9+
10+ export const selectConductorEnable = featureSelector ( flagConductorEnable ) ;
You can’t perform that action at this time.
0 commit comments