mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Fixed mergeDates zero and one item in list (#2360)
The exit clause of the mergeDates function should return an array rather than an object, to ensure that an array is always returned. Because we are using the concat method when recursing, this continues to work for longer lists. We want to return an empty array if list is empty, this protects against returning [undefined]
This commit is contained in:
parent
c2102477a7
commit
94ae33858d
1 changed files with 1 additions and 1 deletions
|
@ -376,7 +376,7 @@ export default class DashboardStatsService extends Service {
|
|||
const [current, ...rest] = list;
|
||||
|
||||
if (!current) {
|
||||
return entry;
|
||||
return entry ? [entry] : [];
|
||||
}
|
||||
|
||||
if (!entry) {
|
||||
|
|
Loading…
Add table
Reference in a new issue