CLASSROOMIO-T-216: Fix loading course multiple times
This commit is contained in:
@@ -39,7 +39,6 @@ Note: Make sure you are using Node 18
|
|||||||
```env
|
```env
|
||||||
PUBLIC_SUPABASE_ANON_KEY=
|
PUBLIC_SUPABASE_ANON_KEY=
|
||||||
PUBLIC_SUPABASE_URL=
|
PUBLIC_SUPABASE_URL=
|
||||||
NETLIFY_API_KEY=
|
|
||||||
OPENAI_API_KEY=
|
OPENAI_API_KEY=
|
||||||
CLOUDFLARE_TOKEN_VALUE=
|
CLOUDFLARE_TOKEN_VALUE=
|
||||||
CLOUDFLARE_ACCESS_KEY=
|
CLOUDFLARE_ACCESS_KEY=
|
||||||
|
|||||||
@@ -15,17 +15,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.386.0",
|
"@aws-sdk/client-s3": "^3.386.0",
|
||||||
"@carbon/charts-svelte": "^1.13.6",
|
"@carbon/charts-svelte": "^1.13.6",
|
||||||
"@sendgrid/mail": "^7.7.0",
|
|
||||||
"@sentry/browser": "^7.61.0",
|
"@sentry/browser": "^7.61.0",
|
||||||
"@sentry/integrations": "^7.61.0",
|
"@sentry/integrations": "^7.61.0",
|
||||||
"@sentry/tracing": "^7.61.0",
|
|
||||||
"@sentry/vite-plugin": "^2.6.2",
|
"@sentry/vite-plugin": "^2.6.2",
|
||||||
"@supabase/supabase-js": "^2.31.0",
|
"@supabase/supabase-js": "^2.31.0",
|
||||||
"@sveltejs/adapter-auto": "^2.1.0",
|
"@sveltejs/adapter-auto": "^2.1.0",
|
||||||
"@sveltejs/adapter-netlify": "^2.0.8",
|
|
||||||
"@tailwindcss/forms": "^0.5.4",
|
"@tailwindcss/forms": "^0.5.4",
|
||||||
"@tinymce/tinymce-svelte": "^1.0.1",
|
"@tinymce/tinymce-svelte": "^1.0.1",
|
||||||
"@types/paystack": "^2.0.1",
|
|
||||||
"@types/pluralize": "0.0.30",
|
"@types/pluralize": "0.0.30",
|
||||||
"ai": "^2.1.31",
|
"ai": "^2.1.31",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
@@ -40,7 +36,6 @@
|
|||||||
"hotkeys-js": "^3.11.2",
|
"hotkeys-js": "^3.11.2",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"netlify": "^13.1.10",
|
|
||||||
"nodemailer": "^6.9.5",
|
"nodemailer": "^6.9.5",
|
||||||
"openai-edge": "^1.2.2",
|
"openai-edge": "^1.2.2",
|
||||||
"pluralize": "^8.0.0",
|
"pluralize": "^8.0.0",
|
||||||
@@ -69,7 +64,6 @@
|
|||||||
"postcss-load-config": "^4.0.1",
|
"postcss-load-config": "^4.0.1",
|
||||||
"sass": "^1.64.2",
|
"sass": "^1.64.2",
|
||||||
"svelte": "^4.1.2",
|
"svelte": "^4.1.2",
|
||||||
"svelte-awesome": "^3.2.1",
|
|
||||||
"svelte-calendar": "^3.1.6",
|
"svelte-calendar": "^3.1.6",
|
||||||
"svelte-dnd-action": "^0.9.24",
|
"svelte-dnd-action": "^0.9.24",
|
||||||
"svelte-loading-spinners": "^0.3.4",
|
"svelte-loading-spinners": "^0.3.4",
|
||||||
|
|||||||
@@ -20,14 +20,17 @@
|
|||||||
|
|
||||||
async function onCourseIdChange(courseId = '') {
|
async function onCourseIdChange(courseId = '') {
|
||||||
console.log('courseid changed', 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);
|
console.log('making request', courseId);
|
||||||
isFetching = true;
|
isFetching = true;
|
||||||
course.set(defaultCourse);
|
course.set(defaultCourse);
|
||||||
|
|
||||||
const { data: _data } = await fetchCourse(courseId);
|
const { data: _data } = await fetchCourse(courseId);
|
||||||
|
|
||||||
setCourse(_data);
|
if (_data) {
|
||||||
|
setCourse(_data);
|
||||||
|
}
|
||||||
|
|
||||||
isFetching = false;
|
isFetching = false;
|
||||||
prevCourseId = courseId;
|
prevCourseId = courseId;
|
||||||
|
|||||||
@@ -45,8 +45,6 @@
|
|||||||
// initialize the expandDescription array with 'false' values for each review.
|
// initialize the expandDescription array with 'false' values for each review.
|
||||||
let expandDescription = Array(reviews.length).fill(false);
|
let expandDescription = Array(reviews.length).fill(false);
|
||||||
|
|
||||||
// const paystackApi = paystack('');
|
|
||||||
|
|
||||||
let activeNav = NAV_ITEMS[0].key;
|
let activeNav = NAV_ITEMS[0].key;
|
||||||
let instructor = {};
|
let instructor = {};
|
||||||
let video: string | undefined;
|
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 <[email protected]>';
|
|
||||||
export const SENDGRID_FROM_NOREPLY = 'ClassroomIO <[email protected]>';
|
|
||||||
|
|
||||||
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 { page, navigating } from '$app/stores';
|
||||||
import isEmpty from 'lodash/isEmpty';
|
import isEmpty from 'lodash/isEmpty';
|
||||||
import * as Sentry from '@sentry/browser';
|
import * as Sentry from '@sentry/browser';
|
||||||
import { Integrations } from '@sentry/tracing';
|
|
||||||
import { CaptureConsole } from '@sentry/integrations';
|
import { CaptureConsole } from '@sentry/integrations';
|
||||||
import posthog from 'posthog-js';
|
import posthog from 'posthog-js';
|
||||||
import { Theme } from 'carbon-components-svelte';
|
import { Theme } from 'carbon-components-svelte';
|
||||||
@@ -57,13 +56,12 @@
|
|||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: 'https://[email protected]/5999999',
|
dsn: 'https://[email protected]/5999999',
|
||||||
integrations: [
|
integrations: [
|
||||||
new Integrations.BrowserTracing(),
|
|
||||||
new CaptureConsole({
|
new CaptureConsole({
|
||||||
levels: ['error']
|
levels: ['error']
|
||||||
}),
|
}),
|
||||||
new Sentry.Replay()
|
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
|
// 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
|
// in development and sample at a lower rate in production
|
||||||
replaysSessionSampleRate: 0.5,
|
replaysSessionSampleRate: 0.5,
|
||||||
|
|||||||
+1
-8
@@ -1,5 +1,4 @@
|
|||||||
import autoAdapter from '@sveltejs/adapter-auto';
|
import autoAdapter from '@sveltejs/adapter-auto';
|
||||||
import netlifyAdapter from '@sveltejs/adapter-netlify';
|
|
||||||
import { vitePreprocess } from '@sveltejs/kit/vite';
|
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
@@ -9,13 +8,7 @@ const config = {
|
|||||||
preprocess: [vitePreprocess({})],
|
preprocess: [vitePreprocess({})],
|
||||||
|
|
||||||
kit: {
|
kit: {
|
||||||
adapter:
|
adapter: autoAdapter()
|
||||||
process.env.ADAPTER === 'NETLIFY'
|
|
||||||
? netlifyAdapter({
|
|
||||||
edge: false,
|
|
||||||
split: true
|
|
||||||
})
|
|
||||||
: autoAdapter()
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user