1
0
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:
Alexander Skvortsov
2020-08-08 13:44:37 -04:00
committed by Franz Liedke
parent 5cd5f27769
commit d14ca79dfa

View File

@@ -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);