mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
update: listItems (filter out null/falsy values)
This commit is contained in:
committed by
Franz Liedke
parent
5cd5f27769
commit
d14ca79dfa
@@ -9,7 +9,7 @@ function withoutUnnecessarySeparators(items) {
|
|||||||
const newItems = [];
|
const newItems = [];
|
||||||
let prevItem;
|
let prevItem;
|
||||||
|
|
||||||
items.forEach((item, i) => {
|
items.filter(Boolean).forEach((item, i) => {
|
||||||
if (!isSeparator(item) || (prevItem && !isSeparator(prevItem) && i !== items.length - 1)) {
|
if (!isSeparator(item) || (prevItem && !isSeparator(prevItem) && i !== items.length - 1)) {
|
||||||
prevItem = item;
|
prevItem = item;
|
||||||
newItems.push(item);
|
newItems.push(item);
|
||||||
|
Reference in New Issue
Block a user