@@ -21,6 +21,7 @@ import {
2121} from '../collabEditing/CollabEditingActions' ;
2222import type { SourceActionType } from '../utils/ActionsHelper' ;
2323import { createContext } from '../utils/JsSlangHelper' ;
24+ import { putJsSlangContext } from '../utils/JsSlangContextStore' ;
2425import { handleCseAndStepperActions } from './reducers/cseReducer' ;
2526import { handleDebuggerActions } from './reducers/debuggerReducer' ;
2627import { handleEditorActions } from './reducers/editorReducer' ;
@@ -95,12 +96,12 @@ const newWorkspaceReducer = createReducer(defaultWorkspaceManager, builder => {
9596 ...state ,
9697 [ workspaceLocation ] : {
9798 ...state [ workspaceLocation ] ,
98- context : createContext < WorkspaceLocation > (
99+ contextId : putJsSlangContext ( createContext < WorkspaceLocation > (
99100 action . payload . library . chapter ,
100101 action . payload . library . external . symbols ,
101102 workspaceLocation ,
102103 action . payload . library . variant
103- ) ,
104+ ) ) ,
104105 globals : action . payload . library . globals ,
105106 externalLibrary : action . payload . library . external . name
106107 }
@@ -360,18 +361,19 @@ const newWorkspaceReducer = createReducer(defaultWorkspaceManager, builder => {
360361 } ;
361362 } )
362363 . addCase ( WorkspaceActions . updateSublanguage , ( state , action ) => {
363- // TODO: Mark for removal
364- const { chapter, variant } = action . payload . sublang ;
365- state . playground . context . chapter = chapter ;
366- state . playground . context . variant = variant ;
364+ // TODO: Mark for removal - this functionality needs to be updated
365+ // to work with the new context store or removed entirely
366+ // const { chapter, variant } = action.payload.sublang;
367+ // state.playground.context.chapter = chapter;
368+ // state.playground.context.variant = variant;
367369 } )
368370 . addCase ( WorkspaceActions . notifyProgramEvaluated , ( state , action ) => {
369371 const workspaceLocation = getWorkspaceLocation ( action ) ;
370372 const debuggerContext = state [ workspaceLocation ] . debuggerContext ;
371373 debuggerContext . result = action . payload . result ;
372374 debuggerContext . lastDebuggerResult = action . payload . lastDebuggerResult ;
373375 debuggerContext . code = action . payload . code ;
374- debuggerContext . context = action . payload . context ;
376+ debuggerContext . contextId = putJsSlangContext ( action . payload . context ) ;
375377 debuggerContext . workspaceLocation = action . payload . workspaceLocation ;
376378 } )
377379 . addCase ( WorkspaceActions . toggleUsingUpload , ( state , action ) => {
0 commit comments