From 2052e0479dc331aa077315b45f495083062041dc Mon Sep 17 00:00:00 2001 From: tuyuribr <45042245+tuyuribr@users.noreply.github.com> Date: Fri, 10 Dec 2021 16:47:07 -0300 Subject: [PATCH] Fix: multiple list sections (#1004) * Fix multiple list sections * singleQuotes * Update src/structures/List.js Co-authored-by: Rajeh Taher --- src/structures/List.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/List.js b/src/structures/List.js index cda1186..9f096ab 100644 --- a/src/structures/List.js +++ b/src/structures/List.js @@ -57,7 +57,7 @@ class List { */ _format(sections){ if(!sections.length){throw '[LT02] List without sections';} - if(sections.length > 1){throw '[LT05] Lists with more than one section are having problems';} + if(sections.length > 1 && sections.filter(s => typeof s.title == 'undefined').length > 1){throw '[LT05] You can\'t have more than one empty title.';} return sections.map( (section) =>{ if(!section.rows.length){throw '[LT03] Section without rows';} return { @@ -76,4 +76,4 @@ class List { } -module.exports = List; \ No newline at end of file +module.exports = List;