@@ -5,7 +5,7 @@ import { call, put, select } from 'redux-saga/effects';
55import { ADD_NEW_USERS_TO_COURSE , CREATE_COURSE } from 'src/features/academy/AcademyTypes' ;
66import { UsernameRoleGroup } from 'src/pages/academy/adminPanel/subcomponents/AddUserPanel' ;
77
8- import { OverallState , Role , styliseSublanguage } from '../../commons/application/ApplicationTypes' ;
8+ import { OverallState , Role } from '../../commons/application/ApplicationTypes' ;
99import {
1010 Assessment ,
1111 AssessmentConfiguration ,
@@ -168,16 +168,6 @@ function* BackendSaga(): SagaIterator {
168168 yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
169169 yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
170170 yield put ( actions . setAssessmentConfigurations ( assessmentConfigurations ) ) ;
171- yield put (
172- actions . updateSublanguage ( {
173- chapter : courseConfiguration . sourceChapter ,
174- variant : courseConfiguration . sourceVariant ,
175- displayName : styliseSublanguage (
176- courseConfiguration . sourceChapter ,
177- courseConfiguration . sourceVariant
178- )
179- } )
180- ) ;
181171 }
182172 yield history . push ( '/academy' ) ;
183173 } ) ;
@@ -187,13 +177,6 @@ function* BackendSaga(): SagaIterator {
187177 function * ( action : ReturnType < typeof actions . fetchUserAndCourse > ) : any {
188178 const tokens = yield selectTokens ( ) ;
189179
190- /**
191- * The updateSublanguage boolean is used to determine whether to update the sublanguage
192- * in the Playground context to match the latest course configuration. We do not want to
193- * update it when the user is accessing the Playground via a shared link.
194- */
195- const updateSublanguage : boolean = action . payload ;
196-
197180 const {
198181 user,
199182 courseRegistration,
@@ -222,18 +205,6 @@ function* BackendSaga(): SagaIterator {
222205 yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
223206 yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
224207 yield put ( actions . setAssessmentConfigurations ( assessmentConfigurations ) ) ;
225- if ( updateSublanguage ) {
226- yield put (
227- actions . updateSublanguage ( {
228- chapter : courseConfiguration . sourceChapter ,
229- variant : courseConfiguration . sourceVariant ,
230- displayName : styliseSublanguage (
231- courseConfiguration . sourceChapter ,
232- courseConfiguration . sourceVariant
233- )
234- } )
235- ) ;
236- }
237208 }
238209 }
239210 ) ;
@@ -243,13 +214,6 @@ function* BackendSaga(): SagaIterator {
243214 const { config } : { config : CourseConfiguration | null } = yield call ( getCourseConfig , tokens ) ;
244215 if ( config ) {
245216 yield put ( actions . setCourseConfiguration ( config ) ) ;
246- yield put (
247- actions . updateSublanguage ( {
248- chapter : config . sourceChapter ,
249- variant : config . sourceVariant ,
250- displayName : styliseSublanguage ( config . sourceChapter , config . sourceVariant )
251- } )
252- ) ;
253217 }
254218 } ) ;
255219
@@ -619,7 +583,6 @@ function* BackendSaga(): SagaIterator {
619583 sourceVariant : sublang . variant
620584 } )
621585 ) ;
622- yield put ( actions . updateSublanguage ( sublang ) ) ;
623586 yield call ( showSuccessMessage , 'Updated successfully!' , 1000 ) ;
624587 }
625588 ) ;
@@ -653,16 +616,6 @@ function* BackendSaga(): SagaIterator {
653616 yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
654617 yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
655618 yield put ( actions . setAssessmentConfigurations ( assessmentConfigurations ) ) ;
656- yield put (
657- actions . updateSublanguage ( {
658- chapter : courseConfiguration . sourceChapter ,
659- variant : courseConfiguration . sourceVariant ,
660- displayName : styliseSublanguage (
661- courseConfiguration . sourceChapter ,
662- courseConfiguration . sourceVariant
663- )
664- } )
665- ) ;
666619 yield call ( showSuccessMessage , `Switched to ${ courseConfiguration . courseName } !` , 5000 ) ;
667620 yield history . push ( '/academy' ) ;
668621 }
@@ -792,16 +745,6 @@ function* BackendSaga(): SagaIterator {
792745 return yield handleResponseError ( resp ) ;
793746 }
794747 yield put ( actions . setAssessmentConfigurations ( placeholderAssessmentConfig ) ) ;
795- yield put (
796- actions . updateSublanguage ( {
797- chapter : courseConfiguration . sourceChapter ,
798- variant : courseConfiguration . sourceVariant ,
799- displayName : styliseSublanguage (
800- courseConfiguration . sourceChapter ,
801- courseConfiguration . sourceVariant
802- )
803- } )
804- ) ;
805748 yield call ( showSuccessMessage , 'Successfully created your new course!' ) ;
806749 yield history . push ( '/academy' ) ;
807750 } ) ;
0 commit comments