chore: store lesson content in localstorage
This commit is contained in:
@@ -130,6 +130,7 @@
|
|||||||
}
|
}
|
||||||
: $lesson;
|
: $lesson;
|
||||||
|
|
||||||
|
console.log('updating lesson');
|
||||||
const [lessonRes] = await Promise.all([
|
const [lessonRes] = await Promise.all([
|
||||||
handleUpdateLessonMaterials(_lesson, lessonId),
|
handleUpdateLessonMaterials(_lesson, lessonId),
|
||||||
saveOrUpdateTranslation($lesson.locale, lessonId)
|
saveOrUpdateTranslation($lesson.locale, lessonId)
|
||||||
@@ -383,6 +384,10 @@
|
|||||||
onChange={(html) => {
|
onChange={(html) => {
|
||||||
if (mode === MODES.view) return;
|
if (mode === MODES.view) return;
|
||||||
$lessonByTranslation[lessonId][$lesson.locale] = html;
|
$lessonByTranslation[lessonId][$lesson.locale] = html;
|
||||||
|
try {
|
||||||
|
// Backup locale of lesson content
|
||||||
|
localStorage.setItem(`lesson-${lessonId}-${$lesson.locale}`, html);
|
||||||
|
} catch (error) {}
|
||||||
$isLessonDirty = true;
|
$isLessonDirty = true;
|
||||||
}}
|
}}
|
||||||
placeholder={$t('course.navItem.lessons.materials.tabs.note.placeholder')}
|
placeholder={$t('course.navItem.lessons.materials.tabs.note.placeholder')}
|
||||||
|
|||||||
Reference in New Issue
Block a user