@@ -5,7 +5,7 @@ import { call, put, select } from 'redux-saga/effects';
5
5
import { ADD_NEW_USERS_TO_COURSE , CREATE_COURSE } from 'src/features/academy/AcademyTypes' ;
6
6
import { UsernameRoleGroup } from 'src/pages/academy/adminPanel/subcomponents/AddUserPanel' ;
7
7
8
- import { OverallState , Role , styliseSublanguage } from '../../commons/application/ApplicationTypes' ;
8
+ import { OverallState , Role } from '../../commons/application/ApplicationTypes' ;
9
9
import {
10
10
Assessment ,
11
11
AssessmentConfiguration ,
@@ -168,16 +168,6 @@ function* BackendSaga(): SagaIterator {
168
168
yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
169
169
yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
170
170
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
- ) ;
181
171
}
182
172
yield history . push ( '/academy' ) ;
183
173
} ) ;
@@ -187,13 +177,6 @@ function* BackendSaga(): SagaIterator {
187
177
function * ( action : ReturnType < typeof actions . fetchUserAndCourse > ) : any {
188
178
const tokens = yield selectTokens ( ) ;
189
179
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
-
197
180
const {
198
181
user,
199
182
courseRegistration,
@@ -222,18 +205,6 @@ function* BackendSaga(): SagaIterator {
222
205
yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
223
206
yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
224
207
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
- }
237
208
}
238
209
}
239
210
) ;
@@ -243,13 +214,6 @@ function* BackendSaga(): SagaIterator {
243
214
const { config } : { config : CourseConfiguration | null } = yield call ( getCourseConfig , tokens ) ;
244
215
if ( config ) {
245
216
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
- ) ;
253
217
}
254
218
} ) ;
255
219
@@ -619,7 +583,6 @@ function* BackendSaga(): SagaIterator {
619
583
sourceVariant : sublang . variant
620
584
} )
621
585
) ;
622
- yield put ( actions . updateSublanguage ( sublang ) ) ;
623
586
yield call ( showSuccessMessage , 'Updated successfully!' , 1000 ) ;
624
587
}
625
588
) ;
@@ -653,16 +616,6 @@ function* BackendSaga(): SagaIterator {
653
616
yield put ( actions . setCourseRegistration ( courseRegistration ) ) ;
654
617
yield put ( actions . setCourseConfiguration ( courseConfiguration ) ) ;
655
618
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
- ) ;
666
619
yield call ( showSuccessMessage , `Switched to ${ courseConfiguration . courseName } !` , 5000 ) ;
667
620
yield history . push ( '/academy' ) ;
668
621
}
@@ -792,16 +745,6 @@ function* BackendSaga(): SagaIterator {
792
745
return yield handleResponseError ( resp ) ;
793
746
}
794
747
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
- ) ;
805
748
yield call ( showSuccessMessage , 'Successfully created your new course!' ) ;
806
749
yield history . push ( '/academy' ) ;
807
750
} ) ;
0 commit comments