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;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import SendGridService from '@sendgrid/mail';
|
||||
import type { MailService } from '@sendgrid/mail';
|
||||
import { SENDGRID_API_KEY } from '$env/static/private';
|
||||
|
||||
export const SENDGRID_FROM = 'Rotimi Best <best@classroomio.com>';
|
||||
export const SENDGRID_FROM_NOREPLY = 'ClassroomIO <help@classroomio.com>';
|
||||
|
||||
export let sendgrid: MailService;
|
||||
|
||||
export const getSendgrid = (): MailService => {
|
||||
if (sendgrid) return sendgrid;
|
||||
|
||||
SendGridService.setApiKey(SENDGRID_API_KEY);
|
||||
|
||||
sendgrid = SendGridService;
|
||||
|
||||
return sendgrid;
|
||||
};
|
||||
@@ -6,7 +6,6 @@
|
||||
import { page, navigating } from '$app/stores';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import { Integrations } from '@sentry/tracing';
|
||||
import { CaptureConsole } from '@sentry/integrations';
|
||||
import posthog from 'posthog-js';
|
||||
import { Theme } from 'carbon-components-svelte';
|
||||
@@ -57,13 +56,12 @@
|
||||
Sentry.init({
|
||||
dsn: 'https://c966f7e8cb1d4306be20b26bb4f0cc96@o476906.ingest.sentry.io/5999999',
|
||||
integrations: [
|
||||
new Integrations.BrowserTracing(),
|
||||
new CaptureConsole({
|
||||
levels: ['error']
|
||||
}),
|
||||
new Sentry.Replay()
|
||||
],
|
||||
environment: !dev ? 'production' : 'development',
|
||||
environment: 'production',
|
||||
// This sets the sample rate to be 10%. You may want this to be 100% while
|
||||
// in development and sample at a lower rate in production
|
||||
replaysSessionSampleRate: 0.5,
|
||||
|
||||
Reference in New Issue
Block a user