1
0
mirror of https://github.com/flarum/core.git synced 2025-10-10 22:44:25 +02:00

Flattening items breaks things; recurse to get the first element instead

This commit is contained in:
Toby Zerner
2015-06-26 13:52:54 +09:30
parent 558d12c870
commit 3ba495091e
2 changed files with 5 additions and 10 deletions

View File

@@ -64,15 +64,6 @@ export default class ItemList {
array = array.map(item => item.content);
//recursively flatten array
for (var i = 0, len = array.length; i < len; i++) {
if (array[i] instanceof Array) {
array = array.concat.apply([], array);
i-- //check current index again and flatten until there are no more nested arrays at that index
len = array.length;
}
}
return array;
}
}