From d14ca79dfacd52cb9f714ef92112645d90d23fa6 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sat, 8 Aug 2020 13:44:37 -0400 Subject: [PATCH] update: listItems (filter out null/falsy values) --- js/src/common/helpers/listItems.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/common/helpers/listItems.js b/js/src/common/helpers/listItems.js index e0c197f4a..bd9bf64cb 100644 --- a/js/src/common/helpers/listItems.js +++ b/js/src/common/helpers/listItems.js @@ -9,7 +9,7 @@ function withoutUnnecessarySeparators(items) { const newItems = []; let prevItem; - items.forEach((item, i) => { + items.filter(Boolean).forEach((item, i) => { if (!isSeparator(item) || (prevItem && !isSeparator(prevItem) && i !== items.length - 1)) { prevItem = item; newItems.push(item);