Fix weird new crash in updateMetrics: contract.id missing?

This commit is contained in:
James Grugett 2022-08-28 00:11:13 -05:00
parent e4f46c48f1
commit 9dd23b4a08

View File

@ -55,7 +55,9 @@ export const updateMetricsCore = async () => {
const now = Date.now()
const betsByContract = groupBy(bets, (bet) => bet.contractId)
const contractUpdates = contracts.map((contract) => {
const contractUpdates = contracts
.filter((contract) => contract.id)
.map((contract) => {
const contractBets = betsByContract[contract.id] ?? []
return {
doc: firestore.collection('contracts').doc(contract.id),