fix: clear current module/lesson when reloading modules for language switch
When setModules is called (e.g., during language switch), clear currentModule and currentLesson to force fresh lookup from the new modules array. This prevents stale module objects from the old language being used.
This commit is contained in:
@@ -23,6 +23,9 @@ export class LessonEngine {
|
||||
*/
|
||||
setModules(modules) {
|
||||
this.modules = modules;
|
||||
// Clear current module/lesson to force reload with new language content
|
||||
this.currentModule = null;
|
||||
this.currentLesson = null;
|
||||
this.loadUserCodeFromStorage();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user