feat: add More Projects section to help dialog
- Add HTML over JS and Web Engineering Mandala projects - Include i18n translations for EN and DE - Add userCode to lesson cache for faster reload
This commit is contained in:
10
src/app.js
10
src/app.js
@@ -207,6 +207,8 @@ function saveUserSettings() {
|
||||
|
||||
// ================= LESSON CACHE =================
|
||||
|
||||
let cachedUserCode = null;
|
||||
|
||||
function restoreLessonCache() {
|
||||
try {
|
||||
const cached = localStorage.getItem("codeCrispies.lessonCache");
|
||||
@@ -230,6 +232,10 @@ function restoreLessonCache() {
|
||||
if (data.levelIndicator && elements.levelIndicator) {
|
||||
elements.levelIndicator.innerHTML = data.levelIndicator;
|
||||
}
|
||||
// Store userCode to apply after editor init
|
||||
if (data.userCode) {
|
||||
cachedUserCode = data.userCode;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore cache errors
|
||||
@@ -471,7 +477,9 @@ function loadCurrentLesson() {
|
||||
lessonTitle: lesson.title,
|
||||
lessonDescription: lesson.description,
|
||||
taskInstruction: lesson.task,
|
||||
levelIndicator: elements.levelIndicator?.innerHTML
|
||||
levelIndicator: elements.levelIndicator?.innerHTML,
|
||||
userCode: engineState.userCode,
|
||||
mode: mode
|
||||
})
|
||||
);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user