Skip to content

Commit

Permalink
Clean up empty training table markup
Browse files Browse the repository at this point in the history
  • Loading branch information
ragesoss committed Nov 9, 2023
1 parent 6c6a878 commit 81c3516
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const TrainingModules = createReactClass({
/>
));

if (!modules.length) { return null; }

const header = this.props.header || 'Training';
const headerId = header.toLowerCase().split(/[^a-z]/).join('-');
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const TrainingModulesViewMode = createReactClass({
const block = this.props.block;
const modules = [];
const length = block.training_modules.length;

if (!length) { return null; }

const partitioned = block.training_modules.reduce((acc, mod) => {
let key = 'modules';
if (mod.kind === EXERCISE_KIND) key = 'exercises';
Expand Down

0 comments on commit 81c3516

Please sign in to comment.