From 82c5eb85d382fccee054896fd7c4d0f24cc5896d Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 8 Mar 2022 11:34:08 -0600 Subject: [PATCH] updateUserBalance: allow negative balances --- functions/src/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/src/utils.ts b/functions/src/utils.ts index f34db1c8..88c25570 100644 --- a/functions/src/utils.ts +++ b/functions/src/utils.ts @@ -53,10 +53,10 @@ const updateUserBalance = ( const newUserBalance = user.balance + delta - if (newUserBalance < 0) - throw new Error( - `User (${userId}) balance cannot be negative: ${newUserBalance}` - ) + // if (newUserBalance < 0) + // throw new Error( + // `User (${userId}) balance cannot be negative: ${newUserBalance}` + // ) if (isDeposit) { const newTotalDeposits = (user.totalDeposits || 0) + delta