diff --git a/common/script/preenUserHistory.js b/common/script/preenUserHistory.js index babec300be..507b24c88b 100644 --- a/common/script/preenUserHistory.js +++ b/common/script/preenUserHistory.js @@ -50,7 +50,7 @@ export function preenHistory (history, isSubscribed, timezoneOffset) { return date.isSame(monthsCutOff) || date.isAfter(monthsCutOff); }); // Aggregate remaining entries by month and year - if (history.length > 0) newHistory.unshift(..._aggregate(aggregateByMonth, 'YYYYMM')); + if (aggregateByMonth.length > 0) newHistory.unshift(..._aggregate(aggregateByMonth, 'YYYYMM')); if (history.length > 0) newHistory.unshift(..._aggregate(history, 'YYYY')); return newHistory;