Fix monthly totals erroring out when updating records

This commit is contained in:
Rory& 2025-09-20 20:03:52 +02:00
parent 6136dace7c
commit 5aa8144ad5

View file

@ -104,6 +104,7 @@ function updateRecords(callStats, records) {
records.totalCallsEverPlaced = callStats.totalCallsEverPlaced; records.totalCallsEverPlaced = callStats.totalCallsEverPlaced;
// Update monthly totals // Update monthly totals
if (!records.monthlyTotals) records.monthlyTotals = {};
records.monthlyTotals[yesterday.getFullYear().toString()][yesterday.getMonth().toString()] = callStats.totalCallsThisMonth; records.monthlyTotals[yesterday.getFullYear().toString()][yesterday.getMonth().toString()] = callStats.totalCallsThisMonth;
if (isNewRecord) { if (isNewRecord) {