Skip to content

Commit

Permalink
2024 Theme: Add guard around missing course outline data
Browse files Browse the repository at this point in the history
See #2531
  • Loading branch information
adamwoodnz committed Jul 4, 2024
1 parent 2b1f642 commit 9f6a59d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { Icon, drafts, lockOutline } from '@wordpress/icons';
import { renderToString } from '@wordpress/element';

document.addEventListener( 'DOMContentLoaded', () => {
if ( ! wporgCourseOutlineData ) {
return;
}

wporgCourseOutlineData[ 'in-progress' ]?.forEach( ( title ) => {
const lessonLinks = document.querySelectorAll( '.wp-block-sensei-lms-course-outline-lesson' );
lessonLinks.forEach( ( link ) => {
Expand Down

0 comments on commit 9f6a59d

Please sign in to comment.