From 3d58d58180161449fea30c9d52c9081d119e651d Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Mon, 11 Sep 2023 13:15:50 +0100 Subject: [PATCH] fix text editor bug --- .../Course/components/Lesson/Materials/index.svelte | 7 ++++--- src/lib/components/TextEditor/index.svelte | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib/components/Course/components/Lesson/Materials/index.svelte b/src/lib/components/Course/components/Lesson/Materials/index.svelte index 7eb74fd5..c8747af8 100644 --- a/src/lib/components/Course/components/Lesson/Materials/index.svelte +++ b/src/lib/components/Course/components/Lesson/Materials/index.svelte @@ -148,7 +148,8 @@ window.players = players; } - function autoSave(updatedMaterials, _isLoading) { + function autoSave(updatedMaterials, _isLoading: boolean, lessonId: string) { + isSaving = false; if (timeoutId) clearTimeout(timeoutId); if (!initAutoSave) { @@ -161,7 +162,7 @@ await saveLesson(updatedMaterials); isSaving = false; - }, 1500); + }, 500); } function handleInputChange() { @@ -176,7 +177,7 @@ $uploadCourseVideoStore.isModalOpen = false; }; - $: autoSave($lesson.materials, $isLoading); + $: autoSave($lesson.materials, $isLoading, lessonId); $: onLessonIdChange(lessonId); diff --git a/src/lib/components/TextEditor/index.svelte b/src/lib/components/TextEditor/index.svelte index 8cf62ed3..5c57f5d7 100644 --- a/src/lib/components/TextEditor/index.svelte +++ b/src/lib/components/TextEditor/index.svelte @@ -1,8 +1,8 @@ -