CLASSROOMIO-T-216: Fix loading course multiple times
This commit is contained in:
@@ -20,14 +20,17 @@
|
||||
|
||||
async function onCourseIdChange(courseId = '') {
|
||||
console.log('courseid changed', courseId);
|
||||
if (!courseId || prevCourseId === courseId || !browser) return;
|
||||
if (!courseId || prevCourseId === courseId || !browser || $course.id === courseId) return;
|
||||
|
||||
console.log('making request', courseId);
|
||||
isFetching = true;
|
||||
course.set(defaultCourse);
|
||||
|
||||
const { data: _data } = await fetchCourse(courseId);
|
||||
|
||||
setCourse(_data);
|
||||
if (_data) {
|
||||
setCourse(_data);
|
||||
}
|
||||
|
||||
isFetching = false;
|
||||
prevCourseId = courseId;
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
// initialize the expandDescription array with 'false' values for each review.
|
||||
let expandDescription = Array(reviews.length).fill(false);
|
||||
|
||||
// const paystackApi = paystack('');
|
||||
|
||||
let activeNav = NAV_ITEMS[0].key;
|
||||
let instructor = {};
|
||||
let video: string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user