0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed usage of nullish coalescing in dashboard mocking (missing file)

This commit is contained in:
Simon Backx 2022-05-18 10:54:50 +02:00
parent 4f52acd433
commit e2ad6e9366

View file

@ -291,10 +291,12 @@ export default class DashboardMocksService extends Service {
negativeDelta: data.paidCanceled negativeDelta: data.paidCanceled
}; };
}); });
const lastStat = stats[stats.length - 1];
const currentCounts = { const currentCounts = {
total: (stats[stats.length - 1]?.paid ?? 0) + (stats[stats.length - 1]?.free ?? 0) + (stats[stats.length - 1]?.comped ?? 0), total: lastStat.paid + lastStat.free + lastStat.comped,
paid: stats[stats.length - 1]?.paid ?? 0, paid: lastStat.paid,
free: (stats[stats.length - 1]?.free ?? 0) + (stats[stats.length - 1]?.comped ?? 0) free: lastStat.free + lastStat.comped
}; };
const cadenceRate = Math.random(); const cadenceRate = Math.random();