Fix type error in update metrics pt.3

This commit is contained in:
Pico2x 2022-09-12 21:49:15 +01:00
parent 5c6fe08bdb
commit 2a96ee98f4

View File

@ -183,9 +183,9 @@ export async function updateMetricsCore() {
try {
const groupUpdates = groups.map((group, index) => {
const groupContractIds = contractsByGroup[index] as GroupContractDoc[]
const groupContracts = groupContractIds.map(
(e) => contractsById[e.contractId]
)
const groupContracts = groupContractIds
.map((e) => contractsById[e.contractId])
.filter((e) => e !== undefined) as Contract[]
const bets = groupContracts.map((e) => {
if (e != null && e.id in betsByContract) {
return betsByContract[e.id] ?? []