Skip to content

Commit

Permalink
Problem with the course previous button
Browse files Browse the repository at this point in the history
Fixes #42
  • Loading branch information
m7medVision committed Feb 14, 2024
1 parent 8601d83 commit b3687c9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions utils/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,12 @@ export function getNumberOfCourses() {
export function findNextCourse(slug: string) {
const FlatSlugs = getFlatSlugs();
const index = FlatSlugs.indexOf(slug);
if (index === -1) {
return slug;
}
return FlatSlugs[index + 1];
}

// Find the previous course ( used in the previous button )
export function findPrevCourse(slug: string) {
const FlatSlugs = getFlatSlugs();
const index = FlatSlugs.indexOf(slug);
if (index === 1) {
return slug;
}
return FlatSlugs[index - 1];
}

0 comments on commit b3687c9

Please sign in to comment.