mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-05 08:42:02 +00:00
Update src/pages/course/[slug]/index.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
9f784f3984
commit
4f093b9e2c
@ -193,10 +193,12 @@ const Course = () => {
|
|||||||
if (slug.includes('naddr')) {
|
if (slug.includes('naddr')) {
|
||||||
setNAddress(slug);
|
setNAddress(slug);
|
||||||
} else {
|
} else {
|
||||||
// todo: no naddress?
|
console.warn('No naddress found in slug');
|
||||||
|
showToast('error', 'Error', 'Course identifier not found in URL');
|
||||||
|
router.push('/courses'); // Redirect to courses page
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [router.isReady, router.query.slug]);
|
}, [router.isReady, router.query.slug, showToast, router]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (router.isReady) {
|
if (router.isReady) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user