diff --git a/functions/src/create-contract.ts b/functions/src/create-contract.ts index ae7b0ad8..e531e1b3 100644 --- a/functions/src/create-contract.ts +++ b/functions/src/create-contract.ts @@ -72,7 +72,6 @@ export const createContract = functions ) return { status: 'error', message: 'Invalid initial probability' } - const ante = FIXED_ANTE // data.ante // uses utc time on server: const today = new Date().setHours(0, 0, 0, 0) const userContractsCreatedTodaySnapshot = await firestore @@ -82,6 +81,8 @@ export const createContract = functions .get() const isFree = userContractsCreatedTodaySnapshot.size === 0 + const ante = isFree ? 300 : FIXED_ANTE // data.ante + if ( ante === undefined || ante < MINIMUM_ANTE ||